By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

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

P: n/a
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();
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> 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" <so*******************@yahoo.com> schrieb im Newsbeitrag
news:#R**************@TK2MSFTNGP10.phx.gbl... 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();

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.