PC Review


Reply
Thread Tools Rate Thread

Calliback from native code into managed with asp.net

 
 
draskin
Guest
Posts: n/a
 
      10th Jan 2007
Hello,

We have a situation where a managed C++ assembly links with native C++ dll.
There is a callback mechanism which calls back into the managed code
asynchronously. Since native classes cannot hold onto a managed reference,
we need to have a managed static member which we access during the callback
and then get into the managed code.

This works great in a console or WinForm app. But in ASP.NET it doesn't. The
reason is that each web site is loaded into its own AppDomain.

After some debugging we found out that the managed static is set on
AppDomain 2, but the callback happens on AppDomain 1 (the default domain).
When the callback code tries to access the managed static - it is undefined.

We found a way to do a call into a different AppDomain, but only when you
already have a reference to that AppDomain and we don't - there doesn't seem
to be a way to enumerate AppDomains in a process.

Has anybody else run into this?

Is there a way to have ASP.NET (or the CLR) to not load the native code into
the neutral domain, instead load it into each AppDomain?

thanks,

Dave Raskin
Rimage Corporation



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass PVOID* to native code from managed code BR Microsoft Dot NET Framework 1 13th Jun 2007 07:54 PM
How to pass PVOID* to native code from managed code BR Microsoft Dot NET 1 13th Jun 2007 07:54 PM
Calliback from native code into managed with asp.net draskin Microsoft ASP .NET 0 9th Jan 2007 11:35 PM
Reference and tutorials using/calling native code (dll) from managed code app Mario Microsoft Dot NET Compact Framework 2 2nd Aug 2006 05:06 PM
managed wrapper to native code.. code from 2003 does not work in 2005? Fred Heida Microsoft Dot NET 0 8th Mar 2006 04:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:14 PM.