471,850 Members | 1,032 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,850 software developers and data experts.

VC2005 problem:IAxWinHostWindow interface in a MFC project

When 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<IOleClientSite> spClientSite(GetControllingUnknown());

hr = m_spOleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL, spClientSite, 0, m_hWnd, &m_rcPos);


The code to create the control is as below, where m_controlWindow is a


RECT rcClient;




if(!m_controlWindow.Create(this->GetSafeHwnd(), rcClient, _T("OutlookBar.PVOutlookBar.1"), WS_CHILD |


return false;

CComPtr<IAxWinHostWindow> 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.


Jul 14 '06 #1
2 3503
9,065 Expert Mod 8TB
The assertion message and the exception bith suggest that you have failed to initialise something somewhere.

0xC0000005: Access violation reading location 0x00000000.

is most normally dereference of a NULL pointer i.e.

Expand|Select|Wrap|Line Numbers
  1. char *p=NULL;
  3. *p = 'B';
sorry I can not be more help, I am just not familiar enough with the classes/methods you are using.
Jul 14 '06 #2
I think you were trying to use ATL classes in MFC container app. Actually, if you want to create an ActiveX control in MFC container apps, you only need to call CWnd::CreateControl.
Nov 1 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by S Shulman | last post: by
3 posts views Thread by Daniel Billingsley | last post: by
1 post views Thread by Bob | last post: by
2 posts views Thread by Mike Collins | last post: by
reply views Thread by fabioraciti | last post: by
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.