473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 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);

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 3647
Banfa
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;
  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

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

Similar topics

6
by: S Shulman | last post by:
Hi I added the MS Chart COM object to my program and it seems to work fine. But when I installed the updated program on the client's machine the I get the following error message file or...
3
by: Daniel Billingsley | last post by:
Today I went to compile a solution I've been working on for months. I've been off most of the last few months, so there's been a gap in the work, but I did compile it a few times earlier this...
1
by: Sin | last post by:
I have a solution in which I have 4 projects. P1 is a EXE project (dependencies : P2 and P4) P2 is a DLL project (dependencies : P4) P3 is a DLL project (dependencies : P2) P4 is a DLL project...
1
by: Bob | last post by:
In a particular project that I'm debugging (compiled as debug, not release) I cannot set a breakpoint inside a particular function. I click to set it, and magically, another file from another...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
7
by: Yuanfei | last post by:
Hi There, I just found that there is a problem in vc2005 regarding to time_t and localtime. See code snippets belows. Using this code segment, I found that when ut is 86200, the corresponding...
0
by: fabioraciti | last post by:
I try to compile a project built using VC++6 in VC++ 2005 and got following errors when trying to build the project after clearing out all the other errors in *.CPP file: error C2248:...
2
by: piyushd.ganj | last post by:
i want any topics (not too much complex)on the c language for minor project in college....
0
mafaisal
by: mafaisal | last post by:
Hello Experts I am Using VB2005 I am Setting Back Ground Image for MdiForm But if we set the Layout of MDIForm RighttoleftLayout property is true then The Background image is not come when the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.