Passing HWND from a MDI app to a activeX control
-
Hi, I want to pass a window handle from my MDI application to one of my active X control's function. I tried doing it , but I recieve a error in my mdi application which is as follows. "cannot convert parameter 3 from 'struct HWND__ *' to 'struct _RemotableHandle *'". The idl in the active X control has the following declaration. "[id(1), helpstring("method Init")] HRESULT Init(LPTSTR lpstrCmdLine, int nCmdShow,HWND hwnd);" Upon compiling the idl I get the following warning "warning MIDL2039 : interface does not conform to [oleautomation] attribute : [ Parameter 'hwnd' of Procedure 'Init' ( Interface 'IIWzIDE' ) ]" Please tell me how I can pass the window handle to my active X control. Thanks a ton in advance belankaar
-
Hi, I want to pass a window handle from my MDI application to one of my active X control's function. I tried doing it , but I recieve a error in my mdi application which is as follows. "cannot convert parameter 3 from 'struct HWND__ *' to 'struct _RemotableHandle *'". The idl in the active X control has the following declaration. "[id(1), helpstring("method Init")] HRESULT Init(LPTSTR lpstrCmdLine, int nCmdShow,HWND hwnd);" Upon compiling the idl I get the following warning "warning MIDL2039 : interface does not conform to [oleautomation] attribute : [ Parameter 'hwnd' of Procedure 'Init' ( Interface 'IIWzIDE' ) ]" Please tell me how I can pass the window handle to my active X control. Thanks a ton in advance belankaar
Hi , Actually HWND data type cannot be used for automation, as it is not supported. so what you can do is simply use long data type, make "HWND hwnd" as "long hwnd" and when u recieve handle in ur activeX object typecast again into HWND Init(LPTSTR lpstrCmdLine, int nCmdShow,long hwnd) { HWND wHandle =(HWND)hwnd; // now you can use this wHandle for your purpose :) ----- ----- } Regards Abhishek Srivastava Software Engg (VC++) India ,Noida Mobile no 9891492921 :)