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 :)