Losing messages to the control of a CAxWindow?



  • 1. CComClassFactorySingleton::CreateInstance not getting called.
    Hello. I am developing a CServiceModule that contains a singleton object. I'm using VC6 ATL dev environment. I placed the DECLARE_CLASSFACTORY_SINGLETON(CObj) macro in the definition of the CObj class. However, when the class factory is called, CComCreator::CreateInstance is called instead. I am attempting to acquire a pointer to the object from within my CServiceModule so that I can work with it. I want the same instance of the object to be used inside the CServiceModule as is being used by VB, etc. Is there something I am overlooking? Thanks. - Roger
  • 2. _com_dispatch_propget
    "Havic Ploccin" <no.email@please> wrote in message news:u7x% XXXX@XXXXX.COM ... > I need to call the stock "ReadyState" property (returns a long) on an MFC > ActiveX control whose IDispatch is available to me in my ATL project. > Anybody knows how to call this using the "_com_dispatch_propget" function? Do you insist on using _com_dispatch_propget? How about this: IDispatch* pDisp; // contol's interface pointer CComVariant varResult; HRESULT hr = CComDispatchDriver::GetProperty(pDisp, DISPID_READYSTATE, &varResult); // or CComDispatchDriver spDriver = pDisp; HRESULT hr = spDriver->GetProperty(DISPID_READYSTATE, &varResult); // or HRESULT hr = spDriver->GetPropertyByName(OLESTR("ReadyState"), &varResult); -- With best wishes, Igor Tandetnik "For every complex problem, there is a solution that is simple, neat, and wrong." H.L. Mencken
  • 3. VBA codes question
    Hi, I just write down some VBA codes for an application. What I need is extract some data from a selected area by mouse left-button. So what should I do ? The most I concerned is how to get the Range object of the shadow area selected by mouse. Thanks.

Losing messages to the control of a CAxWindow?

Postby V2lsbCBHb3JtYW4 » Thu, 14 Oct 2004 08:39:03 GMT

I've got a CAxWindow that's a member of a class derived from CView.  The COM 
component that the CAxWindow is hosting has message handlers so that when the 
CAxWindow is moved, its OnSize handler is called.  However, I've noticed a 
very odd behavior that occurs when certain other applications are open (Spy++ 
for one example).  When those programs are running, the COM component never 
gets the messages when its host CAxWindow is moved.  Basically the order of 
calls goes like this when it works correctly:

   calls m_AxWindow->MoveWindow
CComComponent::OnSize gets called

As soon as something like Spy++ is open CComComponent::OnSize doesn't get 
called but when you close Spy++ again it starts getting called again.

Has anyone else seen an issue similar to this?  Is this some hidden pitfall 
of mixing ATL and MFC?  A sign of an incorrect message map in the COM 
component?  Any insight would be greatly appreciated!

Will Gorman

Similar Threads:

1.Wierd problem: The controls lost their positions and sizes, and error message

Hi there,

I developed a Win32 dialog-based GUI application, and it worked fine in both
Win2K and WinXP computers (I tested it in about 5 computers).

Recently I found something wierd when testing the software in two computers
of our customers (one WinXP Professional Ver 2002 desktop, and a laptop with
WinXP ). For the laptop, the controls lost their original positions and
sizes, for example, the bitmap was put to the left instead of the center,
and the dialog became smaller. In the desktop, I had the same problem and
got one error message: "Debug Assertion Failed. File: filecore.cpp.

Anybody can help?


2.CAxWindow and keyboard messages


In a custom application written using ATL/WTL, I'm hosting (using
CAxWindow) an ActiveX control, that is itself hosting Microsoft Word !

The problem is that Microsoft Word does not receive keyboard messages.

I have checked with Spy++, and none of the windows in the hierarchy
down to Microsoft Word receive keyboard messages.

Do anyone knows where the problem might come from?

Thanks for your time.

3.CAxWindow (atlaxwin71) hosting browser control is very slow for remote http urls

4.CAxWindow Best way to tell control didnt work?

Hello everyone, looking for some idea's

When one creates a CAxWindow, or uses CreateControl, if the control is not
found the window defaults to an IE control and the HRESULT does not show an

Is there a way to tell that the control did not work.


5."Losing" Controls on User Controls


I have been developing with C# User Controls and occasionally have a problem 
where I "lose" a control from the design surface of the User Control.  The 
controls that I am using to build my User Controls are themselves custom 

Occasionally, when I change something in either the User Control and/or one 
of the custom controls that are on it and recompile, when I go to the 
"Visual" design surface of the User Control, the custom control that used to 
be on it is no longer there.  But if you look at the code for the User 
Control, the custom control object is still declared, and any references to 
it in code are still there.  But apparently it's no longer added to the User 
Control in code.

I have a workaround...
1)  Remove declaration of the "lost" object from the User Control code.
2)  Go into the toolbox and get the custom control and put it back on the 
User Control
3)  Set any custom control properties that were set before, and re-register 
for custom control events (because the eventhandler methods are still there 
all I have to do is select the right one thank goodness)

Still, this is an ENORMOUS PAIN IN THE BUTT when it happens.  Can somebody 
tell me how to avoid this situation (Please don't say don't use custom 
controls on User Controls).



6. Web custom control losing event handling on included control

7. First message sent is lost (TCP)

8. MSMQ loses the first message

Return to VC


Who is online

Users browsing this forum: No registered users and 4 guest