开发者

What's the difference between MethodHandle.GetFunctionPointer and Marshal.GetFunctionPointerForDelegate

as stated above I need to know what the difference is between this two possibilities when trying to pass a delegate as a callback to a native DLL. I sometimes have to use the first one and sometimes the second one for my code to work. However, it is unclear to me what's the difference and when to use which possibi开发者_运维技巧lity.

Please enlighten me ;)


To my knowledge, MethodHandle.GetFunctionPointer would be used when you have a MethodInfo object to start with. GetFunctionPointerForDelegate, on the other hand, would be used when you have a delegate to begin with.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜