Click here to Skip to main content
15,878,430 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: reverse division to convert decimals to dinary Pin
David Crow3-Nov-09 2:44
David Crow3-Nov-09 2:44 
AnswerRe: reverse division to convert decimals to dinary Pin
Omegaclass3-Nov-09 19:08
Omegaclass3-Nov-09 19:08 
QuestionUgly Numbers Error Pin
anollipian31-Oct-09 14:21
anollipian31-Oct-09 14:21 
AnswerRe: Ugly Numbers Error Pin
LunaticFringe31-Oct-09 14:30
LunaticFringe31-Oct-09 14:30 
GeneralRe: Ugly Numbers Error Pin
anollipian31-Oct-09 14:44
anollipian31-Oct-09 14:44 
GeneralRe: Ugly Numbers Error Pin
Luc Pattyn1-Nov-09 3:59
sitebuilderLuc Pattyn1-Nov-09 3:59 
QuestionRe: Ugly Numbers Error Pin
David Crow31-Oct-09 16:26
David Crow31-Oct-09 16:26 
Question2 Errors Pin
MrMcIntyre31-Oct-09 6:09
MrMcIntyre31-Oct-09 6:09 
Hi,

I have got 2 errors one saying:

this line contains a '{' which has not yet been matched
end of file found before the left brace '{



<br />
#include <windows.h><br />
<br />
//Global Definitions<br />
#define WINDOW_WIDTH 903<br />
#define WINDOW_HEIGHT 729<br />
<br />
//Global Variables<br />
const char lpClassName[] = "MyProject";<br />
HWND mainWindow;<br />
<br />
//Function Declarations<br />
LRESULT CALLBACK WindowEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)<br />
{<br />
	//Create The Window Class<br />
	WNDCLASSEX wc;<br />
	wc.style = CS_VREDRAW | CS_HREDRAW;<br />
	wc.lpszMenuName = NULL;<br />
	wc.lpszClassName = lpClassName;<br />
	wc.lpfnWndProc = WindowEvent;<br />
	wc.hInstance = hInstance;<br />
	wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);<br />
	wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);<br />
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);<br />
	wc.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);<br />
	wc.cbWndExtra = 0;<br />
	wc.cbSize = sizeof(wc);<br />
	wc.cbClsExtra = 0;<br />
<br />
<br />
	//Register The Windows Class<br />
	RegisterClassEx(&wc);<br />
<br />
	//Create the Window<br />
	mainWindow = CreateWindowEx(<br />
		NULL,<br />
		lpClassName,<br />
		"My Project",<br />
		WS_OVERLAPPEDWINDOW | WS_VISIBLE,<br />
		0,<br />
		0,<br />
		WINDOW_WIDTH,<br />
		WINDOW_HEIGHT,<br />
		NULL,<br />
		NULL,<br />
		hInstance,<br />
		NULL<br />
		);<br />
<br />
	//Make Sure The Window Was A Success<br />
	if (!mainWindow)<br />
		return 0;<br />
<br />
	//Update the Window<br />
	UpdateWindow(mainWindow);<br />
<br />
	//The Main Loop<br />
	MSG msg;<br />
<br />
	while (1)<br />
	{<br />
		if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))<br />
		{<br />
			if (msg.message == WM_QUIT)<br />
			<br />
			TranslateMessage(&msg);<br />
			DispatchMessage(&msg);<br />
	}<br />
<br />
<br />
	return (int) msg.wParam;<br />
}<br />
	//Callback Function (WindowEvent)<br />
	LRESULT CALLBACK WindowEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)<br />
	{<br />
		switch (message)<br />
		{<br />
		case WM_DESTORY:<br />
			PostQuitMessage(0);<br />
			return 0;<br />
			break;<br />
<br />
		<br />
		return DefWindowProc(hWnd, message, wParam, lParam);<br />
	}<br />
<br />
<br />


Andrew McIntyre

AnswerRe: 2 Errors Pin
Chris Losinger31-Oct-09 6:10
professionalChris Losinger31-Oct-09 6:10 
AnswerRe: 2 Errors Pin
enhzflep31-Oct-09 6:17
enhzflep31-Oct-09 6:17 
GeneralRe: 2 Errors Pin
MrMcIntyre31-Oct-09 6:25
MrMcIntyre31-Oct-09 6:25 
GeneralRe: 2 Errors Pin
enhzflep31-Oct-09 6:36
enhzflep31-Oct-09 6:36 
GeneralRe: 2 Errors Pin
MrMcIntyre31-Oct-09 6:40
MrMcIntyre31-Oct-09 6:40 
AnswerRe: 2 Errors Pin
David Crow31-Oct-09 16:33
David Crow31-Oct-09 16:33 
QuestionFunctional Parameters Pin
Paul Belikian31-Oct-09 3:59
Paul Belikian31-Oct-09 3:59 
AnswerRe: Functional Parameters Pin
Randor 31-Oct-09 4:08
professional Randor 31-Oct-09 4:08 
GeneralRe: Functional Parameters Pin
Paul Belikian31-Oct-09 4:20
Paul Belikian31-Oct-09 4:20 
AnswerRe: Functional Parameters Pin
Richard MacCutchan31-Oct-09 4:11
mveRichard MacCutchan31-Oct-09 4:11 
GeneralRe: Functional Parameters Pin
Paul Belikian31-Oct-09 4:21
Paul Belikian31-Oct-09 4:21 
QuestionHow to find unallocated sector in a disk programaticaaly Pin
Shiv Murti Pal31-Oct-09 2:24
Shiv Murti Pal31-Oct-09 2:24 
AnswerRe: How to find unallocated sector in a disk programaticaaly Pin
enhzflep31-Oct-09 3:40
enhzflep31-Oct-09 3:40 
Joke[OT] Re: How to find unallocated sector in a disk programaticaaly Pin
David Crow31-Oct-09 16:35
David Crow31-Oct-09 16:35 
GeneralRe: [OT] Re: How to find unallocated sector in a disk programaticaaly Pin
enhzflep31-Oct-09 16:49
enhzflep31-Oct-09 16:49 
QuestionRe: How to find unallocated sector in a disk programaticaaly Pin
Randor 31-Oct-09 3:44
professional Randor 31-Oct-09 3:44 
QuestionRunning a process as Administrator in Vista, Windows 2008? Pin
Kushagra Tiwari31-Oct-09 1:05
Kushagra Tiwari31-Oct-09 1:05 

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.