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

C / C++ / MFC

 
QuestionRead Text from Image file Pin
Game-point14-Sep-09 18:38
Game-point14-Sep-09 18:38 
AnswerRe: Read Text from Image file Pin
«_Superman_»14-Sep-09 19:33
professional«_Superman_»14-Sep-09 19:33 
AnswerRe: Read Text from Image file Pin
Cedric Moonen14-Sep-09 20:21
Cedric Moonen14-Sep-09 20:21 
QuestionCoCreateInstance getting the wrong coclass Pin
PaulowniaK14-Sep-09 17:01
PaulowniaK14-Sep-09 17:01 
AnswerRe: CoCreateInstance getting the wrong coclass Pin
Stuart Dootson14-Sep-09 20:39
professionalStuart Dootson14-Sep-09 20:39 
GeneralRe: CoCreateInstance getting the wrong coclass Pin
PaulowniaK14-Sep-09 20:43
PaulowniaK14-Sep-09 20:43 
AnswerRe: CoCreateInstance getting the wrong coclass Pin
Stuart Dootson15-Sep-09 0:42
professionalStuart Dootson15-Sep-09 0:42 
QuestionCode Help Pin
MrMcIntyre14-Sep-09 10:45
MrMcIntyre14-Sep-09 10:45 
Hi, I was wondering if someone could look at this code and tell me what I have done wrong. I have been trying to create a Win32 client but I get build errors. Thanks

<br />
#include <windows.h><br />
<br />
//Global Definitions<br />
#define WINDOW_WIDTH 980<br />
#define WINDOW_HEIGHT 750<br />
<br />
//Global Variables <br />
const char lpClassName[] = "MyProject";<br />
HWND mainWindow<br />
<br />
//Function Declarations<br />
LRESULT CALLBACK WindowEvent(HWND, UINT message, WPARAM wParam, LPARAM, lParam);<br />
<br />
int WINAPI WinMain(HINSTANCE, hInstance, HINSTANCE, hPrevInstance, LPSTR lpCmdLine, int nShowCmd<br />
<br />
{<br />
	//Create The Windows Class<br />
	WNDCLASSEX wc;<br />
	wc.style = CS_VREDRAW | CS_HREDRAW;<br />
	wc.lpszMenuName = NULL;<br />
	wc.lpfnWndProc = WindowEvent;<br />
	wc.hInstance = hInstance;<br />
	wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);<br />
	wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);<br />
	wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);<br />
	wc.cbWndExtra = 0;<br />
	wc.cbSize = sizeof(wc);<br />
	wc.cbClsExtra = 0;<br />
<br />
	//Register the Window Class<br />
	RegisterClassEx(&wc);<br />
<br />
	//Create The Window<br />
	mainWindow = CreateWindowEx(<br />
		NULL,<br />
		lpClassName,<br />
		"MyProject",<br />
		WS_OVERLAPPEDWINDOW | WS_VISIBLE, <br />
		(GetSystemMetrics(SM_CXSCREEN) / 2 - (WINDOW_WIDTH / 2),<br />
		(GetSystemMetrics(SM_CYSCREEN) / 2 - (WINDOW_HEIGHT / 2),<br />
		WINDOW_WIDTH,<br />
		WINDOW_HEIGHT<br />
		NULL,<br />
		NULL,<br />
		hInstance,<br />
		NULL<br />
		);<br />
<br />
	//Make Sure The Window Was A Sucess<br />
	if (!mainWindow)<br />
		return 0;<br />
	<br />
	//Update The Window<br />
	UpdateWindow(mainWindow);<br />
<br />
	//The Main Loop<br />
	MSG msg;<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 />
	return (int) msg.wParam;<br />
	}<br />
	<br />
//Callback Function (WindowEvent)<br />
LRESULT CALLBACK WindowEvent(HWND, UINT message, WPARAM wParam, LPARAM, lParam);<br />
{<br />
	switch (message)<br />
	{<br />
	case WM_DESTROY:<br />
		PostQuitMessage(0);<br />
		return 0;<br />
		break;<br />
	}<br />
<br />
	return DefWindowProc(hWnd, message, wParam, lParam);<br />
}<br />


Andrew McIntyre

QuestionRe: Code Help Pin
CPallini14-Sep-09 11:15
mveCPallini14-Sep-09 11:15 
AnswerRe: Code Help Pin
Richard MacCutchan14-Sep-09 11:43
mveRichard MacCutchan14-Sep-09 11:43 
AnswerRe: Code Help Pin
Adam Roderick J14-Sep-09 18:01
Adam Roderick J14-Sep-09 18:01 
Question[Message Deleted] Pin
Jim Fell14-Sep-09 9:45
Jim Fell14-Sep-09 9:45 
AnswerRe: Reading ASCII File TAB is Replace with NULL Pin
David Crow14-Sep-09 10:06
David Crow14-Sep-09 10:06 
QuestionActive windows Pin
mishudev14-Sep-09 8:58
mishudev14-Sep-09 8:58 
AnswerRe: Active windows Pin
Randor 14-Sep-09 9:52
professional Randor 14-Sep-09 9:52 
QuestionSetting a controls background to transparent Pin
Deepak.Prahlad14-Sep-09 7:47
Deepak.Prahlad14-Sep-09 7:47 
AnswerRe: Setting a controls background to transparent Pin
Randor 14-Sep-09 9:50
professional Randor 14-Sep-09 9:50 
GeneralRe: Setting a controls background to transparent Pin
Deepak.Prahlad14-Sep-09 19:22
Deepak.Prahlad14-Sep-09 19:22 
GeneralRe: Setting a controls background to transparent Pin
Randor 15-Sep-09 0:19
professional Randor 15-Sep-09 0:19 
GeneralRe: Setting a controls background to transparent Pin
Deepak.Prahlad15-Sep-09 1:08
Deepak.Prahlad15-Sep-09 1:08 
GeneralRe: Setting a controls background to transparent Pin
Randor 15-Sep-09 3:06
professional Randor 15-Sep-09 3:06 
GeneralRe: Setting a controls background to transparent Pin
Deepak.Prahlad15-Sep-09 4:55
Deepak.Prahlad15-Sep-09 4:55 
GeneralRe: Setting a controls background to transparent Pin
Randor 15-Sep-09 5:42
professional Randor 15-Sep-09 5:42 
GeneralRe: Setting a controls background to transparent Pin
Deepak.Prahlad15-Sep-09 23:25
Deepak.Prahlad15-Sep-09 23:25 
GeneralRe: Setting a controls background to transparent Pin
Randor 16-Sep-09 1:50
professional Randor 16-Sep-09 1:50 

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.