can a delegate method be latebound in a c# dll?

D

Daniel

How do I call a delegate in late bound C# dll? there some way to do this w/
a sharedinterface file? any examples? i tried this but it doesnt work:

(oType.GetMethod("IOCTLJOB").Invoke(pObj, new object[] {
pClass1.m_job } )).ToString();

and it returns the error:

Additional information: Object type cannot be converted to target type.

I have the delegate defined in both the late bound dll and the host assembly
like this:
public delegate void Job();
 
C

cody

How do I call a delegate in late bound C# dll? there some way to do this
w/
a sharedinterface file? any examples? i tried this but it doesnt work:

(oType.GetMethod("IOCTLJOB").Invoke(pObj, new object[] {
pClass1.m_job } )).ToString();

Maybe "pObj" is not of type "oType", or the argument you are passing
("pClass1.m_job") cannot converted to the argument the method expects.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
Daniel said:
How do I call a delegate in late bound C# dll? there some way to do this w/
a sharedinterface file? any examples? i tried this but it doesnt work:

(oType.GetMethod("IOCTLJOB").Invoke(pObj, new object[] {
pClass1.m_job } )).ToString();

and it returns the error:

Additional information: Object type cannot be converted to target type.

I have the delegate defined in both the late bound dll and the host assembly
like this:
public delegate void Job();
 

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