COM Interop messes with IE hosted windows forms control

Discussion in 'ASP .Net' started by Dilip, Dec 29, 2004.

  1. Dilip

    Dilip Guest

    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
    Dilip, Dec 29, 2004
    #1
    1. Advertising

  2. Dilip

    Steve Lutz Guest

    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" <> wrote in message
    news:...
    > 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, Dec 30, 2004
    #2
    1. Advertising

  3. Dilip

    Dilip Guest

    Steve Lutz wrote:
    > 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.
    Dilip, Dec 30, 2004
    #3
  4. Dilip

    Dilip Guest

    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?
    Dilip, Dec 30, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Theule

    Windows Control hosted in WebForm

    Matt Theule, Oct 31, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    446
    Matt Theule
    Oct 31, 2003
  2. Velio Ivanov
    Replies:
    1
    Views:
    402
    Steve C. Orr [MVP, MCSD]
    May 18, 2004
  3. Keith
    Replies:
    4
    Views:
    778
    Andrew Robinson
    Nov 21, 2005
  4. =?Utf-8?B?Qm9zY28=?=
    Replies:
    0
    Views:
    414
    =?Utf-8?B?Qm9zY28=?=
    Aug 9, 2006
  5. JEFF
    Replies:
    1
    Views:
    1,007
    =?Utf-8?B?YnJpYW5zW01DU0Rd?=
    Nov 12, 2007
Loading...

Share This Page