DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: C# - COM Interop Threading Modal

  1. #1
    Jim Brooke Guest

    C# - COM Interop Threading Modal

    Here is the deal. I have a C# assembly that needs to be called from an
    global.asa in ASP. The problem is that when I try adding it to the
    Application object I get a message complaining that it can't add an object
    with threading modal set to STA/MTA. So my question is how can I change the
    threading modal to Free Threaded?

    Thanks

    -J



  2. #2
    Patrick Steele [MVP] Guest

    Re: C# - COM Interop Threading Modal

    In article <3ece3b52$1@tnews.web.devx.com>, Brooke@hotmail.com says...
    > Here is the deal. I have a C# assembly that needs to be called from an
    > global.asa in ASP. The problem is that when I try adding it to the
    > Application object I get a message complaining that it can't add an object
    > with threading modal set to STA/MTA. So my question is how can I change the
    > threading modal to Free Threaded?


    Use the MTAThread attribute.

    --
    Patrick Steele
    Microsoft .NET MVP
    http://radio.weblogs.com/0110109

  3. #3
    Jim Brooke Guest

    Re: C# - COM Interop Threading Modal

    But that only has affect on the method level. The solution (if you want to
    call it that) I used was not trying to stick it in the Application object
    and instead just make this call in the global.asa:

    <object id="oFree" scope="application" progid="COMObject.NetObject"
    runat="server"></object>

    This worked great!

    Thanks.

    "Patrick Steele [MVP]" <patrick@mvps.org> wrote in message
    news:MPG.19380e8fa2421e389896cf@news.devx.com...
    > In article <3ece3b52$1@tnews.web.devx.com>, Brooke@hotmail.com says...
    > > Here is the deal. I have a C# assembly that needs to be called from an
    > > global.asa in ASP. The problem is that when I try adding it to the
    > > Application object I get a message complaining that it can't add an

    object
    > > with threading modal set to STA/MTA. So my question is how can I change

    the
    > > threading modal to Free Threaded?

    >
    > Use the MTAThread attribute.
    >
    > --
    > Patrick Steele
    > Microsoft .NET MVP
    > http://radio.weblogs.com/0110109




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center