When I tried to use the IAxWinHostWindo w interface in a MFC project I get the following
An assert in CComTypeInfoHol der::GetTI(LCID lcid) at
ATLASSUME(!Inli neIsEqualGUID(* m_plibid, GUID_NULL) && "Did you forget to pass the LIBID to CComModule::Ini t?");
If I ignore this assert then I get
Unhandled exception at 0x0176cfa8 in testcontAINER.e xe: 0xC0000005: Access violation reading location 0x00000000.
at the lines in ActivateAx
CComQIPtr<IOleC lientSite> spClientSite(Ge tControllingUnk nown());
hr = m_spOleObject->DoVerb(OLEIVER B_INPLACEACTIVA TE, NULL, spClientSite, 0, m_hWnd, &m_rcPos);
RedrawWindow(NU LL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_INTERNALPAI NT | 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_controlWi ndow.Create(thi s->GetSafeHwnd( ), rcClient, _T("OutlookBar. PVOutlookBar.1" ), WS_CHILD |
WS_VISIBLE | WS_CLIPCHILDREN , WS_EX_CLIENTEDG E/*,IDC_OUTLOOKBA R*/))
return false;
CComPtr<IAxWinH ostWindow> spHost;
HRESULT hr = m_controlWindow .QueryHost(&spH ost);
_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
2 3665 Banfa 9,065
Recognized Expert Moderator Expert
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.
sorry I can not be more help, I am just not familiar enough with the classes/methods you are using.
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::CreateCon trol.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 assembly name MSDATASRC was not found
Can that be related to the fact that I have office 2002 and my client has
office XP?
Thank you in advance
Shmuel
|
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 week.
Today I get a message:
Could not write to output file
'D:\DevelopmentProjects\Enterprise\CustomUtilities\obj\Debug\CustomUtilities
..dll' -- 'The process cannot access the file because it is being used by
another process. '
|
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 (dependencies : None)
All of these projects are plain unmanaged win32, no COM, no ATL, no MFC,
etc.
|
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 project is opened in the IDE, and
the new breakpoint is set there, in a random location. And I get all
questionmarks on the existing breakpoints I set before I started debugging
("The breakpoint will not currently be hit"). I checked and there is only...
|
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 set to...it is set to
false.
Can someone show me what I am doing wrong and tell me the correct way? Thank
you.
In the page load event, I am doing the following:
| |
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 output is 1970.1.1 7:56:40, when ut is 0,
the output is 1970.1.1 8:00:00, when ut is 86400, the output is 1970.1.2
8:00:00. While output will be 1970 1.2 7:56:40 in VC8. Please note that I
am aware that time_t is 64bit in VC2005 and using...
|
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: 'CObject::CObject': cannot access private member declared
in class 'CObject' file c:\programmi\microsoft visual studio
8\vc\atlmfc\include
\afx.h(553) : see declaration of 'CObject::CObject'
c:\programmi\microsoft visual studio...
|
by: piyushd.ganj |
last post by:
i want any topics (not too much complex)on the c language for minor
project in college....
|
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 system run, if RighttoleftLayout is False then no problem
Project as in Arabic
, righttoleft is needed, Hw to overcome this
Plz Help
Faisal
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |