Click here to Skip to main content
15,885,953 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Custom combobox Pin
James Brown24-Jan-06 8:24
James Brown24-Jan-06 8:24 
GeneralRe: Custom combobox Pin
Nishad S24-Jan-06 16:42
Nishad S24-Jan-06 16:42 
QuestionError occure when destructor is not virtual ? Pin
vikas amin24-Jan-06 1:28
vikas amin24-Jan-06 1:28 
AnswerRe: Error occure when destructor is not virtual ? Pin
Cedric Moonen24-Jan-06 2:51
Cedric Moonen24-Jan-06 2:51 
GeneralRe: Error occure when destructor is not virtual ? Pin
vikas amin24-Jan-06 19:22
vikas amin24-Jan-06 19:22 
AnswerRe: Error occure when destructor is not virtual ? Pin
sunit524-Jan-06 6:47
sunit524-Jan-06 6:47 
QuestionInstaller pack of MFC app. Pin
Aryan S24-Jan-06 1:26
Aryan S24-Jan-06 1:26 
QuestionStatic WndProc() Pin
virtualrush24-Jan-06 1:25
virtualrush24-Jan-06 1:25 
Hi
Im just learning how to wrap a window procedure and i am following this tutorial from stromcode.

I am wondering why would I have to create an object of the class first and then store it as pointer variable (Win32WrapperClass* pWnd)?

Is there a reason why this has to be done, because i thought that if i create a Win32WrapperClass object now it would have no relation to the Win32WrapperClass i would create in my main.cpp

<br />
/* static window procedure */<br />
LRESULT CALLBACK Win32WrapperClass::stWinProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)<br />
{<br />
<br />
Win32WrapperClass* pWnd;<br />
<br />
	if (uMsg == WM_NCCREATE) {<br />
		// Set the pointer<br />
		SetWindowLong(hWnd, GWL_USERDATA, (long)((LPCREATESTRUCT(lParam))->lpCreateParams));<br />
	}<br />
<br />
	// Get the pointer<br />
	pWnd = (Win32WrapperClass *)GetWindowLong(hWnd, GWL_USERDATA);<br />
<br />
	// If we got it, call the windows message handler, otherwise call the default<br />
	if (pWnd)	return pWnd->WinProc(hWnd, uMsg, wParam, lParam);<br />
	else		return DefWindowProc(hWnd, uMsg, wParam, lParam);<br />


any help on this would be great

cheers
AnswerRe: Static WndProc() Pin
Vipin Aravind24-Jan-06 2:55
Vipin Aravind24-Jan-06 2:55 
AnswerRe: Static WndProc() Pin
Cedric Moonen24-Jan-06 3:02
Cedric Moonen24-Jan-06 3:02 
QuestionCFormView in MDI Pin
anandforu24-Jan-06 0:14
anandforu24-Jan-06 0:14 
AnswerRe: CFormView in MDI Pin
Vipin Aravind24-Jan-06 2:51
Vipin Aravind24-Jan-06 2:51 
GeneralRe: CFormView in MDI Pin
anand_dayalans24-Jan-06 5:40
anand_dayalans24-Jan-06 5:40 
GeneralRe: CFormView in MDI Pin
anand_dayalans24-Jan-06 5:49
anand_dayalans24-Jan-06 5:49 
QuestionCreate TabView for IShellPropSheetExt Pin
souso2024-Jan-06 0:12
souso2024-Jan-06 0:12 
QuestionRemote Task manager Pin
SatyaDY24-Jan-06 0:03
SatyaDY24-Jan-06 0:03 
AnswerRe: Remote Task manager Pin
NarasimhuluM24-Jan-06 0:31
NarasimhuluM24-Jan-06 0:31 
AnswerRe: Remote Task manager Pin
Robsori24-Jan-06 0:33
Robsori24-Jan-06 0:33 
GeneralRe: Remote Task manager Pin
SatyaDY24-Jan-06 2:50
SatyaDY24-Jan-06 2:50 
QuestionSetParent Pin
heajinkim23-Jan-06 23:55
heajinkim23-Jan-06 23:55 
AnswerRe: SetParent Pin
domehead24-Jan-06 6:51
domehead24-Jan-06 6:51 
Questionhow to launch a notepad with the supplied information Pin
rampaul23-Jan-06 23:41
rampaul23-Jan-06 23:41 
AnswerRe: how to launch a notepad with the supplied information Pin
toxcct23-Jan-06 23:50
toxcct23-Jan-06 23:50 
AnswerRe: how to launch a notepad with the supplied information Pin
Owner drawn24-Jan-06 0:17
Owner drawn24-Jan-06 0:17 
AnswerRe: how to launch a notepad with the supplied information Pin
Prakash Nadar24-Jan-06 0:30
Prakash Nadar24-Jan-06 0:30 

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.