What is wrong with this appresolver

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
 
G

Guest

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
 
B

Boni

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
 

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