What is wrong with this appresolver

  • Thread starter Thread starter Boni
  • Start date Start date
B

Boni

Dear all,

please help me to find a right way of writing the resolver.

Thanks so much,

Boni

Assembly *XXX::ResolveMe(Object *sender, ResolveEventArgs *args){

...

}

//In Constructor

AppDomain* _ad= AppDomain::get_CurrentDomain()->AssemblyResolve += new
ResolveEventHandler(ResolveMe); //error C3350



error C3350: 'System::ResolveEventHandler' : a delegate constructor expects
two arguments
 
Boni said:
Dear all,

please help me to find a right way of writing the resolver.

Thanks so much,

Boni

Assembly *XXX::ResolveMe(Object *sender, ResolveEventArgs *args){

...

}

//In Constructor

AppDomain* _ad= AppDomain::get_CurrentDomain()->AssemblyResolve += new
ResolveEventHandler(ResolveMe); //error C3350



error C3350: 'System::ResolveEventHandler' : a delegate constructor expects
two arguments


Ah, I see. You can either make your ResolveMe event handler static or pass
the *this* pointer as the first argument when you are binding the event
handler.

AppDomain* _ad= AppDomain::get_CurrentDomain()->AssemblyResolve += new
ResolveEventHandler(this,ResolveMe);

Thanks,
Kapil
 
Thank you, it worked :)
Kapil Khosla said:
Ah, I see. You can either make your ResolveMe event handler static or pass
the *this* pointer as the first argument when you are binding the event
handler.

AppDomain* _ad= AppDomain::get_CurrentDomain()->AssemblyResolve += new
ResolveEventHandler(this,ResolveMe);

Thanks,
Kapil
 
Back
Top