COM Interop messes with IE hosted windows forms control

D

Dilip

Hi

I have a windows forms user control that is hosted in IE. This control
uses COM Interop to access some RTC related interfaces. The control
does not display itself correctly because of this COM reference. IF I
remove all references to the tlbimp'ed COM dll, the control displays
just fine. Basically a plain vanilla user control has no problems
displaying itself.

Upon further investigation with fuslogvw, I found out that the MSHTML
component is not getting loaded whenever I leave the COM referencing
code inside my control.

What am I doing wrong?

thanks
--Dilip
 
S

Steve Lutz

I would think that there is a problem with the COM references then. The user
control cannot load the DLL, so it "bombs" and doesn't display anything. Is
the ASP.NET site compiled? Does the site have access to the COM .DLL file
when it tries to load the page? Have you attempted to walk through a page
load with the debugger?
 
D

Dilip

Steve said:
I would think that there is a problem with the COM references then. The user
control cannot load the DLL, so it "bombs" and doesn't display anything. Is
the ASP.NET site compiled? Does the site have access to the COM .DLL file
when it tries to load the page? Have you attempted to walk through a page
load with the debugger?

I am sure there is nothing wrong with finding the references. I have
tlbimp'ed the original COM tlb and linked my .NET application with it.
In fact the windows forms control, the tlbimp'ed dll and a .manifest
file are all in the same directory (\inetpub\wwwroot). As I said, when
I look at fuslogvw, I can see the DLLs getting loaded properly. Its
just that the control doesn't render itself on the web page. It
_could_ be because I am making calls to unmanaged code in the control's
ctor and the control is not given access to call unmanaged code. The
thing is I don't understand how to set this permission.
Some help would be greatly appreciated.
 
D

Dilip

Actually I have now found out what the problem is. My winforms user
control actually has a manifest file that indicates which version of
the COM DLL to load (the dll in question is Rtcdll.dll specified in the
<dependantassembly> section). Apparently this manifest file is never
being referred to -- consequently calls to methods on a specific
interface fails. The same code works as a stand alone app where the
manifest file is not ignored.
How do I ensure that the manifest file is not ignored?
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top