[For Igor] <OBJECT> tag gives AXWIN Frame errors

A

Arsen V.

Hi,

I have an object that derives from the following:

class ATL_NO_VTABLE CToolBandObj :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CToolBandObj, &CLSID_ToolBandObj>,
public IDeskBand,
public IObjectWithSiteImpl<CToolBandObj>,
public IPersistStream,
public IInputObject,
public IDispatchImpl<IToolBandObj, &IID_IToolBandObj, &LIBID_CTOOLBANDLib>,
public IDispEventImpl<1, CToolBandObj, &DIID_DWebBrowserEvents2,
&LIBID_SHDocVw, 1, 0>,
public IOleCommandTarget,
public IDocHostUIHandler

The IToolBandObj interface has a few properties: for example CityID (both
put and get).

The installation occurs through a .CAB.

The original installation page uses document.location.href (after <OBJECT>
loaded) to transfer the user to a page that instantiates the newly installed
object using <OBJECT> and clsid. It manipulates the properties.

Now, when this second page is closed, there is an error that says AXWIN
Frame iexplorer read from inaccessible memory location.

How should I approach this problem?

If I take away the <OBJECT> from the second page, everything works okay. So
it looks like if the ToolBandObj is not loaded as the IDeskBand (since the
browser was not opened a new yet), accessing it through the <OBJECT> tag
causes problems.

Thank you for all your previous help! It really help me. (As you can see ATL
is new to me).

Arsen
 
I

Igor Tandetnik

Arsen V. said:
If I take away the <OBJECT> from the second page, everything works
okay. So it looks like if the ToolBandObj is not loaded as the
IDeskBand (since the browser was not opened a new yet), accessing it
through the <OBJECT> tag causes problems.

Why do you even want to instantiate it with <object> ? It's likely not
designed to work when hosted on HTML page. It is designed to work as a
toolbar hosted by IE. It probably crashes because it cannot obtain some
interfaces it expects.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
 
A

Arsen V.

Hi Igor,

I implemented it to work when hosted on HTML page. And it does work most of
the time.

I need the functionality in order to set the values (such as CityID) of the
object from JavaScript that is dynamically generated on the server and sent
to the browser.

The only case when this does not work in <OBJECT> instantiation is when the
window that instantiates it using <OBJECT> does not itself show the toolbar.
If a window does show the toolbar the <OBJECT> instantiation works okay.

What Interfaces am I missing for <OBJECT> instantiation?

Thank you for your reply!
Arsen
 
I

Igor Tandetnik

Arsen V. said:
The only case when this does not work in <OBJECT> instantiation is
when the window that instantiates it using <OBJECT> does not itself
show the toolbar. If a window does show the toolbar the <OBJECT>
instantiation works okay.

Are you by any chance initializing some global variables when
instantiated in toolbar mode? May it be that the crash is due to the
fact that these variables are not being initialized when there's no
toolbar?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
 
A

Arsen V.

Are you by any chance initializing some global variables when
instantiated in toolbar mode? May it be that the crash is due to the
fact that these variables are not being initialized when there's no
toolbar?

It appears to happen only after I close the window. After the window is
closed in about 1-2 seconds the AXWIN Frame iexplorer.exe error appears.

When I look at the ALTRACE of the object, I notice that it does have a
chance to execute its FinalRelease and the destructor. The error appears
only after this point.

I do have Global variables defined by they are initialized in a file that is
called Globals.cpp and it is included in the same .cpp file that declares
the CComModule and OBJECT_ENTRY(). So it looks like it should be accessible
to all.

Do you know if the DllMain() gets called when I use the <OBJECT> tag? The
call to AtlAxWinInit() is inside of my DllMain() when dwReason is
DLL_PROCESS_ATTACH.

Thanks for helping! Any other suggestions?

Arsen
 
I

Igor Tandetnik

Arsen V. said:
Do you know if the DllMain() gets called when I use the <OBJECT> tag?

Of course. DllMain is called by OS loader when the DLL is loaded.
Naturally, IE can't instantiate an object implemented in a DLL without
loading said DLL first.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top