Ok, i created a class CWindow, got it running perfectly no problems there. The problem is when i derive a class from it say, CAppWindow. Well I have a function create in both classes that is virtual, since the CreateWindowEx function has to put (void*)this into the LPARAM lplparam to pass to WndPrco I was wondering if I can just do CWindow::Create() or do I have to write the function for the derived class over? Or is it safe to call the bass class's create function? I guess in other words it what im saying is when i call the base class CWindow::Create() is it going to pass a this* to the base class or a this* to the derived class? Ex:
void CWindow::Create()
{ if(!bInitFail)
{ hWnd = CreateWindowEx(WS_EX_APPWINDOW,
"CWINDOW",
"Window!",
WS_OVERLAPPED | WS_SYSMENU,
50,
50,
300,
200,
NULL,
NULL,
hInst,
(void*)this);
}
if(!hWnd)
{ bInitFail = true;
MessageBox(NULL,"Error Creating Window","ERROR IN APPLICATION STARTUP",MB_OK);
}
so if i do:
void CAppWindow::Create()
{ CWindow::Create();
}
Will the this* be of the base class or the derived class?