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

  • Thread starter Thread starter José Joye
  • Start date Start date
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);
//...
 
Back
Top