Click here to Skip to main content
15,902,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralClipboard notification Pin
User 66587-May-02 7:01
User 66587-May-02 7:01 
GeneralYup Pin
7-May-02 7:22
suss7-May-02 7:22 
Questionwho knows that? Pin
Atilla Selem7-May-02 6:38
Atilla Selem7-May-02 6:38 
AnswerRe: who knows that? Pin
Chris Losinger7-May-02 6:49
professionalChris Losinger7-May-02 6:49 
GeneralDrag and Drop bitmaps !!! Pin
Hadi Rezaee7-May-02 4:56
Hadi Rezaee7-May-02 4:56 
GeneralRe: Drag and Drop bitmaps !!! Pin
Chris Hambleton7-May-02 5:23
Chris Hambleton7-May-02 5:23 
GeneralRe: Drag and Drop bitmaps !!! Pin
Hadi Rezaee7-May-02 5:43
Hadi Rezaee7-May-02 5:43 
GeneralQ: how to obtain interface pointer for ATL ActiveX control in an MFC app Pin
Gil Clark7-May-02 4:53
Gil Clark7-May-02 4:53 
OK, I'm relatively new to ATL/ActiveX/COM.

We have an MFC application (CView and CDialog usage) built with VC++6 SP5.
I am in the process of creating an ActiveX control (via ATL) that will be used by this application, but I'm having a problem.

I can insert the control onto the template in the resource editor and it shows up. I run the application and the control functions properly. But I need to have access to the interface of that control.

I used:
CAxWindow m_axTheControlWindow;
CComPtr<ITheControlInterface> m_ctlTheControl;

CWnd* pControl = GetDlgItem(IDC_THECONTROLID);
if (pControl)
{
m_axTheControlWindow.Attach(pControl->GetSafeHwnd());
hr = m_axTheControlWindow.QueryControl(&m_ctlTheControl);
if (FAILED(hr) || !m_ctlTheControl)
{
ATLASSERT(false);
}
}

but QueryControl returns E_FAIL and m_ctlTheControl is NULL.
I guess it has something to do with how MFC keeps track of OLE controls (COleControlContainer) ???
Perhaps the only way I could communicate with this control would be via IDispatch?

The control was create via the VC++ Insert | New ATL Object... wizard. It's a Full Control (Single Threaded, Dual interface, No aggregation, Support ISupportErrorInfo, support connection points, not based on another control, normalize dc, insertable, opaque, solid background, no stock properties).
Now, this is just the bare-bones wizard code. Nothing has been implemented as far as IDispatch or ISupportErrorInfo or connection points beyond what the wizard gives, but I didn't want to go too far before finding out it wasn't going to work.

Thanks for any help.
Gil
GeneralRe: Q: how to obtain interface pointer for ATL ActiveX control in an MFC app Pin
Gil Clark8-May-02 7:13
Gil Clark8-May-02 7:13 
GeneralDisplay a dialog box from a DLL COM Pin
Jerome Conus7-May-02 4:38
Jerome Conus7-May-02 4:38 
GeneralRe: Display a dialog box from a DLL COM Pin
Chris Losinger7-May-02 5:08
professionalChris Losinger7-May-02 5:08 
GeneralRe: Display a dialog box from a DLL COM Pin
Jerome Conus7-May-02 5:13
Jerome Conus7-May-02 5:13 
GeneralRe: Display a dialog box from a DLL COM Pin
Jonathan Craig7-May-02 5:46
Jonathan Craig7-May-02 5:46 
GeneralRe: Display a dialog box from a DLL COM Pin
Jerome Conus7-May-02 5:55
Jerome Conus7-May-02 5:55 
Questiondoes CTreeCtrl have this function? Pin
7-May-02 4:23
suss7-May-02 4:23 
AnswerRe: does CTreeCtrl have this function? Pin
Philip Patrick7-May-02 6:35
professionalPhilip Patrick7-May-02 6:35 
AnswerRe: does CTreeCtrl have this function? Pin
Joel Lucsy7-May-02 11:33
Joel Lucsy7-May-02 11:33 
Questiondoes CTreeCtrl have this fuction? Pin
7-May-02 4:19
suss7-May-02 4:19 
AnswerRe: does CTreeCtrl have this fuction? Pin
Chris Losinger7-May-02 4:26
professionalChris Losinger7-May-02 4:26 
GeneralSome DLL questions !!! Pin
Hadi Rezaee7-May-02 4:15
Hadi Rezaee7-May-02 4:15 
GeneralRe: Some DLL questions !!! Pin
Chris Losinger7-May-02 4:27
professionalChris Losinger7-May-02 4:27 
GeneralRe: Some DLL questions !!! Pin
Hadi Rezaee7-May-02 5:08
Hadi Rezaee7-May-02 5:08 
GeneralRe: Some DLL questions !!! Pin
Paul M Watt7-May-02 5:23
mentorPaul M Watt7-May-02 5:23 
GeneralRe: Some DLL questions !!! Pin
Paul M Watt7-May-02 5:20
mentorPaul M Watt7-May-02 5:20 
GeneralRe: Some DLL questions !!! Pin
Hadi Rezaee7-May-02 6:19
Hadi Rezaee7-May-02 6:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.