Connecting Tech Pros Worldwide Forums | Help | Site Map

COM Interop messes with IE hosted windows forms control

Dilip
Guest
 
Posts: n/a
#1: Nov 19 '05
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

Steve Lutz
Guest
 
Posts: n/a
#2: Nov 19 '05

re: COM Interop messes with IE hosted windows forms control


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?


"Dilip" <rdilipk@lycos.com> wrote in message
news:1104357571.493794.302040@z14g2000cwz.googlegr oups.com...[color=blue]
> 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
>[/color]


Dilip
Guest
 
Posts: n/a
#3: Nov 19 '05

re: COM Interop messes with IE hosted windows forms control



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

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.

Dilip
Guest
 
Posts: n/a
#4: Nov 19 '05

re: COM Interop messes with IE hosted windows forms control


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?

Closed Thread