January 28th, 2005, 04:12 PM
How to get interface to ActiveX control?
I am attempting to obtain a pointer to an activex control's interface w/ only a handle to the control. Here's what I'm doing:
hr = wGrid.GetDlgControl(nCtrlID, IID_IUnknown, (void**)&pUnk);
The return to hr is always E_FAIL however. I've also tried similar code w/ the CAxWindow class and AtlAxGetControl function. Every time, I get a return of E_FAIL. Does anyone know how to get a pointer to the interface so that I can retrieve data from this control? Thanks.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!