Home › Forums › C++ Programming › Problem with control container
- This topic has 0 replies, 1 voice, and was last updated 18 years, 5 months ago by nigredo.
- AuthorPosts
- July 14, 2006 at 6:19 am #1945nigredoParticipantWhen I tried to use the IAxWinHostWindow interface in a MFC project I get the following
An assert in CComTypeInfoHolder::GetTI(LCID lcid) at
ATLASSUME(!InlineIsEqualGUID(*m_plibid, GUID_NULL) && “Did you forget to pass the LIBID to CComModule::Init?”);
If I ignore this assert then I get
Unhandled exception at 0x0176cfa8 in testcontAINER.exe: 0xC0000005: Access violation reading location 0x00000000.
at the lines in ActivateAx
CComQIPtr
spClientSite(GetControllingUnknown()); hr = m_spOleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL, spClientSite, 0, m_hWnd, &m_rcPos);
RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_INTERNALPAINT | RDW_FRAME);
The code to create the control is as below, where m_controlWindow is a
CAxWindow
RECT rcClient;
GetClientRect(&rcClient);
AtlAxWinInit();
USES_CONVERSION;
if(!m_controlWindow.Create(this->GetSafeHwnd(), rcClient, _T(“OutlookBar.PVOutlookBar.1”), WS_CHILD |
WS_VISIBLE | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE/*,IDC_OUTLOOKBAR*/))
return false;
CComPtr
spHost; HRESULT hr = m_controlWindow.QueryHost(&spHost);
_bstr_t str(“OutlookBar.PVOutlookBar.1”);
hr = spHost->CreateControl(str, m_controlWindow, 0);
I can create the control in the ATLCon example for VC2005 but not in an MFC Container App created using VC2005.
Does anyone know why this is not working and how I can fix it.
Thanks
Katherine
- AuthorPosts
- The forum ‘C++ Programming’ is closed to new topics and replies.