Click here to Skip to main content
15,886,872 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: I really do hate string streams Pin
Jörgen Sigvardsson10-Feb-06 11:25
Jörgen Sigvardsson10-Feb-06 11:25 
AnswerRe: I really do hate string streams Pin
Jörgen Sigvardsson10-Feb-06 11:37
Jörgen Sigvardsson10-Feb-06 11:37 
GeneralRe: I really do hate string streams Pin
PJ Arends10-Feb-06 12:04
professionalPJ Arends10-Feb-06 12:04 
GeneralRe: I really do hate string streams Pin
Jörgen Sigvardsson10-Feb-06 12:15
Jörgen Sigvardsson10-Feb-06 12:15 
GeneralRe: I really do hate string streams Pin
PJ Arends10-Feb-06 12:22
professionalPJ Arends10-Feb-06 12:22 
QuestionAPI to enable/disable Windows SP2 Firewall on a given connection? Pin
Carl Mirabel10-Feb-06 9:41
Carl Mirabel10-Feb-06 9:41 
AnswerRe: API to enable/disable Windows SP2 Firewall on a given connection? Pin
Blake Miller13-Feb-06 4:12
Blake Miller13-Feb-06 4:12 
Questioncreating a window... Pin
Peter Charlesworth10-Feb-06 8:51
Peter Charlesworth10-Feb-06 8:51 
hey guys

i've recently started a nex project and this time i want to make things more fancier; i'm going to output the program in a windows window

i've written the code for creating such a window, but i have one error and i don't seem to be able to sort it out

The error is:

Error E2040 bcc11.cpp 5: decleration terminated incorrectly

can anyone help?

(i'm using borland c++ compiler 5.5 btw)

here's the code:


	<br />
        //oorspronkelijk gevonden op:http://www.ronkes.nl/programmeren/pengo/vensters.asp<br />
#include <windows.h><br />
int WINAPI WinMain(HINSTANCE instance, HINSTANCE previousInstance, LPSTR commandLine, int show);<br />
int main();<br />
{	LRESULT CALLBACK WindowProc(HWND windowHandle, UINT message, WPARAM wParam, LPARAM lParam)<br />
	return DefWindowProc(windowHandle, message, wParam, lParam);<br />
	WNDCLASS myWindowClass<br />
	{<br />
		myWindowClass.hbrBackground = (HBRUSH) GetStockObject(TRANSPARENT_BRUSH);<br />
		myWindowClass.hCursor = LoadCursor(NULL, IDC_ARROW);<br />
		myWindowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);<br />
		myWindowClass.hInstance = instance;<br />
		myWindowClass.lpfnWndProc = WindowProc;<br />
		myWindowClass.lpszClassName = "StandardWindowClass";<br />
		myWindowClass.style = CS_VREDRAW | CS_HREDRAW;<br />
		myWindowClass.style = CS_VREDRAW | CS_HREDRAW;<br />
		myWindowClass.cbClsExtra = 0;<br />
		myWindowClass.cbWndExtra = 0;<br />
		RegisterClass(&myWindowClass);<br />
	}<br />
<br />
	HWND myWindowHandle = CreateWindow(<br />
	"StandardWindowClass",       			// naam van de window class<br />
	"Test bcc11",					// titel van het venster<br />
	WS_OVERLAPPED | WS_VISIBLE | WS_SYSMENU,	// vensterstijl<br />
	CW_USEDEFAULT, CW_USEDEFAULT,			// positie van het venster<br />
	CW_USEDEFAULT, CW_USEDEFAULT,			// grootte van het venster<br />
	0, 0,                        			// deze parameters gebruiken wij niet<br />
	instance,                    			// de instantie van de applicatie<br />
	0);                          			// deze parameter gebruiken wij niet<br />
<br />
	MSG msg;<br />
<br />
	do<br />
	{<br />
			// is er een bericht naar het venster gestuurd?<br />
		if (PeekMessage(&msg, myWindowHandle, 0, 0, PM_REMOVE))<br />
		{<br />
			// vertaal bericht<br />
		TranslateMessage(&msg);<br />
<br />
			// verstuur bericht naar window procedure<br />
		DispatchMessage(&msg);<br />
<br />
		}<br />
	} while (true);<br />
{<br />
		// welk bericht heeft het venster ontvangen?<br />
	switch (message)<br />
	{<br />
	case WM_CLOSE:<br />
		{<br />
				// de gebruiker sluit het venster<br />
				// beëindig het programma<br />
			PostQuitMessage(0);<br />
<br />
			return 0;<br />
		}<br />
	}<br />
<br />
	return DefWindowProc(windowHandle, message, wParam, lParam);<br />
} <br />
while (msg.message != WM_QUIT);<br />
}<br />



Thanks alot!

Peter
Answercreating a window... Pin
Peter Charlesworth10-Feb-06 8:57
Peter Charlesworth10-Feb-06 8:57 
GeneralRe: creating a window... Pin
Peter Charlesworth10-Feb-06 8:59
Peter Charlesworth10-Feb-06 8:59 
GeneralRe: creating a window... Pin
David Crow10-Feb-06 9:15
David Crow10-Feb-06 9:15 
GeneralRe: creating a window... Pin
Peter Charlesworth10-Feb-06 10:05
Peter Charlesworth10-Feb-06 10:05 
AnswerRe: creating a window... Pin
Michael Dunn10-Feb-06 11:09
sitebuilderMichael Dunn10-Feb-06 11:09 
QuestionCListView question Pin
RobJones10-Feb-06 8:22
RobJones10-Feb-06 8:22 
AnswerRe: CListView question Pin
David Crow10-Feb-06 9:19
David Crow10-Feb-06 9:19 
GeneralRe: CListView question Pin
RobJones10-Feb-06 9:27
RobJones10-Feb-06 9:27 
QuestionImmediate Display of Edit Box Pin
jon_fallon10-Feb-06 8:19
jon_fallon10-Feb-06 8:19 
AnswerRe: Immediate Display of Edit Box Pin
David Crow10-Feb-06 9:22
David Crow10-Feb-06 9:22 
AnswerRe: Immediate Display of Edit Box Pin
PJ Arends10-Feb-06 9:59
professionalPJ Arends10-Feb-06 9:59 
GeneralRe: Immediate Display of Edit Box Pin
jon_fallon10-Feb-06 10:04
jon_fallon10-Feb-06 10:04 
QuestionCRecordset ? DoFieldExchange ?? Pin
zinc_z10-Feb-06 8:17
zinc_z10-Feb-06 8:17 
QuestionRe: CRecordset ? DoFieldExchange ?? Pin
David Crow10-Feb-06 9:26
David Crow10-Feb-06 9:26 
AnswerRe: CRecordset ? DoFieldExchange ?? Pin
zinc_z11-Feb-06 15:05
zinc_z11-Feb-06 15:05 
QuestionRe: CRecordset ? DoFieldExchange ?? Pin
David Crow13-Feb-06 8:17
David Crow13-Feb-06 8:17 
AnswerRe: CRecordset ? DoFieldExchange ?? Pin
zinc_z15-Feb-06 3:26
zinc_z15-Feb-06 3:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.