AppDomain and delegate... How?????

J

José Joye

I have created a new AppDomain from within my window Service.
I need to pass some delegates to an instance of a class loaded in the other
appDomain.

With the way I currently do it, the delegates get called. HOWEVER, in the
second appDomain and not
in my main AppDomain.
The class that contains the delegates is derived from MarshalByRefObject.

Heeeeeelp!
Thanks :)




========Snippet of my code =============
// ...
AppDomain gAppDomain;
gAppDomain = AppDomain.CreateDomain ("FileAcquistionRamitAppDomain", null,
setup);
Object o = gAppDomain.CreateInstanceAndUnwrap(
Assembly.GetExecutingAssembly().FullName,

typeof(RamitReceiveWrapper).FullName);

// local object to access object located in other AppDomain
RamitWrapperAppDomain = (FileAcquisition.RamitReceiveWrapper)o;

//
// initialize callbacks for customized treatments /// <----- here I pass
my delegates
//
gcbProcImg = new RamitReceiveWrapper.FProcImg(FileReceiver.StoreImage);
gcbExitRamit = new RamitReceiveWrapper.FExitRamit(FileReceiver.ExitRamit);
RamitWrapperAppDomain.DefineRamitDelegates(ref gcbProcImg, ref
gcbExitRamit);
//...
 

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

Top