.cpp omzette naar .exe

Status
Niet open voor verdere reacties.

jimowns

Gebruiker
Lid geworden
2 sep 2006
Berichten
341
ik ben nog maar een beginner in C++ .
kan iemand me aub stap voor stap uitleggen hoe ik een .cpp bestand kan omzette in .exe zodat de .exe werkt.

alvast bedankt .
 
ik ben vergeten te zegge hoe ik cpp program met errors in een .exe file krijg als ik op F9 druk compile het maar dan zie ik naar complile log en daar krijg ik 18 error weet iemand hoe ik die errors kan oplosse en met de errors erbij in een .exe file .
 
wat voorn errors heb je ? ik gebruik opdracht promt en dan moet je bcc32 jaap.cpp
(stel dat jaap de naam is van je programma)
 
de erros heb ik al opgelost met visual C++ . maar toch bedankt .

ik use visual C++ Express Edition maar hoe krijg ik ik een .exe file ik ben maar een beginner .
eigenlijk probeer ik dit in .exe file te zette .

/*
###############################################################
#### ----------------------------------------- #############
#### - Project: Window Classer - #############
#### ----------------------------------------- #############
###############################################################
#### ----------------------------------------- #############
#### - Bestand: main.cpp - #############
#### ----------------------------------------- #############
###############################################################
#### ----------------------------------------- #############
#### - Datum: Vrijdag 01 September 2006 - #############
#### ----------------------------------------- #############
###############################################################
*/

// Include de windows bestanden waar de Win32 api zich in bevind
#include <windows.h>
#include <windowsx.h>

//
// Header waar alle prototypes in staan etc etc
//
#include "header.h"

//
// Class en functie prototypen
//
#include "class_window.cpp"
#include "class_window.cpp"

//
// Globals
//
HINSTANCE main_instance = NULL;


/**
* Functie main, hier start het programma
*
* @param HINSTANCE hinstance Handle naar het programma zelf
* @param HINSTANCE hprevivinstance Vorige instantie/handle
* @param LPSTR lpcmdline Long Pointer Commandline
* @param INT ncmdshow
*/
int WINAPI WinMain( HINSTANCE hinstance,HINSTANCE hprevinstance,LPSTR lpcmdline,int ncmdshow )
{

// definieer paar variablen voor de main loop
MSG msg;

// maak een referenctie naar het proces handle
main_instance = hinstance;


//
// Window 1
//
cWindowClass c_wnd;
c_wnd.h_main_instance = hinstance;
c_wnd.Build( "Schermpie met menu :D", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 500, 400, "Window1" );


//
// Menu
//

HMENU hmenu, hfile, hhelp, hfile_new;
hmenu = CreateMenu();

hfile = CreatePopupMenu();

AppendMenu(hmenu, MF_STRING | MF_POPUP, (UINT) hfile, "Menu");

hfile_new = CreatePopupMenu();
AppendMenu( hfile, MF_STRING | MF_POPUP, (UINT) hfile_new, "Nieuw" );

AppendMenu( hfile_new, MF_STRING, ID_NEW_TEXT, "Tekstdocument" );
AppendMenu( hfile_new, MF_STRING, ID_NEW_PHP, "PHP Document" );
AppendMenu( hfile_new, MF_STRING, ID_NEW_HTML, "HTML Document" );
AppendMenu( hfile_new, MF_STRING, ID_NEW_CSS, "CSS Document" );
AppendMenu( hfile_new, MF_STRING, ID_NEW_XML, "XML Document" );

AppendMenu(hfile, MF_STRING, ID_FILE_EXIT, "E&xit");
hhelp = CreatePopupMenu();

AppendMenu( hmenu, MF_STRING | MF_POPUP, ( UINT ) hhelp, "Help" );
AppendMenu( hhelp, MF_STRING, ID_HELP_HELP, "Help mij!" );
AppendMenu( hhelp, MF_STRING, ID_HELP_ABOUT, "Over mij!" );

SetMenu(c_wnd.window_handle, hmenu);


//
// Window 2
//
cWindowClass window2;
window2.h_main_instance = hinstance;
window2.Build( "Schermpiej 2", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 600, 100, 500, 400, "Window2" );

//
// Window 3
//
cWindowClass window3;
window3.h_main_instance = hinstance;
window3.Build( "Schermpie 3 :)", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 40, 100, 500, 400, "Window3" );

while( true )
{
// kijken ofals er een berichtje is binnengekomen
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{

// filter het bericht eruit en voer actie uit
switch( msg.message )
{

case WM_QUIT:
{

PostQuitMessage(0);

break;
} // end case WM_QUIT

case WM_CREATE: // process word gecreeërd
{


break;
} // end case WM_CREATE



} // end switch msg.message

// translate any accelerator keys
TranslateMessage(&msg);

// send the message to the window proc
DispatchMessage(&msg);

} // end if PeekMessage(..)


} // end while true( main loop )

// return to Windows like this
return(msg.wParam);

} // end function WinMain( .. )


ik hoop dat je me kunt helpen met dit ik weet niet dat jij visual C++ Express edition gebruikt .
maar als je echt wilt uitleggen hoe ik dit in een .exe file krijg ben ik u zeer dankbaar ervoor .
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan