ActiveX control retrieving parent information problem

I'm working on the ActiveX control which window is supose to be child of the ClientView window of the MDI application. I have some questions...
1. How I can (from the ActiveX) retrieve informations such are hInstance handle of the MDI application and hWnd of the Client View window?
I tried with GetWindowLong(), but compiler reports following error:
Code:
...
   HWND hWndParent;

   hWndParent = ::GetWindowLong(m_hWnd,
GWL_HWNDPARENT );
...
Error:
C2440: '=' : cannot convert from 'long' to 'struct HWND__ *'
      
What is going on here?
Thanks!

Apolo.
LVL 5
ekcAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
MS changes several data types from VC5 to VC6, which leads to results like this (the same with HINSTANCE, HBRUSH, etc.). Simply change your code to read


   hWndParent = ::GetWindowLong( ( HWND) m_hWnd,
GWL_HWNDPARENT );

and it should work...
0
 
ekcAuthor Commented:
Adjusted points to 200
0
 
ekcAuthor Commented:
Correct conversion is:

hWndParent = ( HWND) ::GetWindowLong( m_hWnd, GWL_HWNDPARENT );

Easy points, ha?
0
All Courses

From novice to tech pro — start learning today.