How to get HWND of VC++ OCX from VB Client
-
Hello, I've an OCX written in MFC, and am trying to use it from a VB Client. To be able to
PostMessage()
within my control I need theHWND
. Any VB client (as per info on the net), does not supportHWND
for OLE Controls (my OCX is one!). My control's "this
" has the "hWnd
" as0x00000000
when I use the OCX from a VB Client! But it properly works from the ActiveX Test Container, or from a VC++ client. Is this correctable, or am I doing anything wrong? Thanks, Rgds, Nirav Doshi -
Hello, I've an OCX written in MFC, and am trying to use it from a VB Client. To be able to
PostMessage()
within my control I need theHWND
. Any VB client (as per info on the net), does not supportHWND
for OLE Controls (my OCX is one!). My control's "this
" has the "hWnd
" as0x00000000
when I use the OCX from a VB Client! But it properly works from the ActiveX Test Container, or from a VC++ client. Is this correctable, or am I doing anything wrong? Thanks, Rgds, Nirav Doshiif you want HWND to control then use HWND hWnd = GetSafeHwnd(); if you want handle to container use HWND m_hwndContainer = GetParent()->GetSafeHwnd();
-
if you want HWND to control then use HWND hWnd = GetSafeHwnd(); if you want handle to container use HWND m_hwndContainer = GetParent()->GetSafeHwnd();
Pradeep Maskeri wrote: HWND m_hwndContainer = GetParent()->GetSafeHwnd(); Thanks Pradeep for your reply... But I had already tried this, without help! :((:| * Don't wish it was easier, wish you were better! *