Click here to Skip to main content
15,922,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCreateWindowEx is stupid and nonsensical Pin
super_matt29-Oct-03 7:56
super_matt29-Oct-03 7:56 
GeneralRe: CreateWindowEx is stupid and nonsensical Pin
alex.barylski29-Oct-03 10:03
alex.barylski29-Oct-03 10:03 
GeneralRe: CreateWindowEx is stupid and nonsensical Pin
super_matt29-Oct-03 11:17
super_matt29-Oct-03 11:17 
GeneralRe: CreateWindowEx is stupid and nonsensical Pin
Steve S29-Oct-03 22:43
Steve S29-Oct-03 22:43 
GeneralRe: CreateWindowEx is stupid and nonsensical Pin
David Crow30-Oct-03 2:18
David Crow30-Oct-03 2:18 
GeneralRe: CreateWindowEx is stupid and nonsensical Pin
Steve S30-Oct-03 4:49
Steve S30-Oct-03 4:49 
GeneralRe: CreateWindowEx is stupid and nonsensical Pin
David Crow30-Oct-03 2:20
David Crow30-Oct-03 2:20 
GeneralRe: CreateWindowEx is stupid and nonsensical Pin
super_matt30-Oct-03 7:50
super_matt30-Oct-03 7:50 
I have taken working procedural code and tried to object orient it, all i really changed was instead of executing global methods i execute class members. i have made sure that works, i have tried procedural code executing those class members, it works. the only thing i really changed was making my WndProc static, and passing (void* this) to it as the LPVOID param, then casting it back. i think my problem is maybe in my WndProc method, but i don't know what it is. I have tried making my WndProc call MessageBox() and create a message box that tells that it was entered, i read that WndProc is called before CreateWindowEx or CreateWindow returns so, those messageboxes should appear, but they aren't so i can only assume that therin lies my problem.

here is my WndProc:

LRESULT CALLBACK GLWindow::WndProc(HWND hWnd,
LPARAM lParam,
WPARAM wParam,
UINT uMsg)
{
// GLWindow is my window class, i am trying to create a wrapper to create openGL windows
GLWindow* pWnd;

if (uMsg == WM_NCCREATE)
{
MessageBox(hWnd,"WM_NCCREATE","WndProc Message",MB_OK | MB_ICONINFORMATION);
assert(((LPCREATESTRUCT(lParam))->lpCreateParams));

SetWindowLong(hWnd, GWL_USERDATA, (long)((LPCREATESTRUCT(lParam))->lpCreateParams));
}
else if (uMsg == WM_CREATE)
{
MessageBox(hWnd,"WM_CREATE","WndProc Message",MB_OK | MB_ICONINFORMATION);
assert(((LPCREATESTRUCT(lParam))->lpCreateParams));
SetWindowLong(hWnd, GWL_USERDATA, (long)((LPCREATESTRUCT(lParam))->CreateParams));
}


pWnd = GetGLWindowPtr(hWnd);

if (pWnd != NULL)
return pWnd->MsgHandler(hWnd, uMsg, wParam, lParam, pWnd);
else
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}

can you see my problem?

-Matt
GeneralHelp - COM Ports Pin
raheela29-Oct-03 7:12
raheela29-Oct-03 7:12 
GeneralRe: Help - COM Ports Pin
David Crow29-Oct-03 7:26
David Crow29-Oct-03 7:26 
GeneralVisual C++.net Removing Member Variable Pin
mfcuser29-Oct-03 6:48
mfcuser29-Oct-03 6:48 
GeneralRe: Visual C++.net Removing Member Variable Pin
Peter Molnar29-Oct-03 13:53
Peter Molnar29-Oct-03 13:53 
Questionhow to get a list of ALL the truetype fonts Pin
JP GOBLET29-Oct-03 6:43
JP GOBLET29-Oct-03 6:43 
AnswerRe: how to get a list of ALL the truetype fonts Pin
David Crow29-Oct-03 7:21
David Crow29-Oct-03 7:21 
GeneralRe: how to get a list of ALL the truetype fonts Pin
JP GOBLET29-Oct-03 21:29
JP GOBLET29-Oct-03 21:29 
GeneralCHtmlView Pin
includeh1029-Oct-03 6:36
includeh1029-Oct-03 6:36 
GeneralRe: CHtmlView Pin
Peter Molnar29-Oct-03 13:32
Peter Molnar29-Oct-03 13:32 
GeneralCTime causes exceptions Pin
Daniel132429-Oct-03 6:35
Daniel132429-Oct-03 6:35 
GeneralRe: CTime causes exceptions Pin
David Crow29-Oct-03 6:40
David Crow29-Oct-03 6:40 
GeneralRe: CTime causes exceptions Pin
Daniel132429-Oct-03 6:42
Daniel132429-Oct-03 6:42 
GeneralRe: CTime causes exceptions Pin
JohnJ29-Oct-03 7:00
JohnJ29-Oct-03 7:00 
GeneralRe: CTime causes exceptions Pin
David Crow29-Oct-03 7:05
David Crow29-Oct-03 7:05 
GeneralRe: CTime causes exceptions Pin
Daniel132429-Oct-03 11:27
Daniel132429-Oct-03 11:27 
QuestionVersion info? Pin
mcgahanfl29-Oct-03 6:17
mcgahanfl29-Oct-03 6:17 
AnswerRe: Version info? Pin
Chris Meech29-Oct-03 6:32
Chris Meech29-Oct-03 6:32 

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.