468,513 Members | 1,772 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

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);

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

Thanks

Katherine
Jul 14 '06 #1
2 3369
Banfa
9,056 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;
  2.  
  3. *p = 'B';
  4.  
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
By using this site, you agree to our Privacy Policy and Terms of Use.