-
pointer to hWnd
how can i access my programs main hWnd in my class without making it global and externing it? Im currently trying to access it by passing it's memory address to my class using functions but all it seems to pass is garbage.
Code:
void Paddle::SethWnd(HWND *hWnd)
{
hWindow = hWnd;
}
HWND* Paddle::GethWnd()
{
return hWindow;
}
these are currently the functions i am using to pass it, and access it.
hWindow is a private member variable of the class and is a HWND*.
Ive tryed calling the SethWnd function in InitInstance and in WndProc either way i seem to get garbage, thanks in advance for any help.
-
HWND is already a pointer and will not change throughout your program unless you manually change it. In other words:
just pass HWND hwnd, not HWND *hwnd
-
ah I see, just did a recompile and now i see my paddle on the screen, thanks alot.