kevin_deng2008

i want to use some function from teh xxx.h file in c#(add native code to managed code)

I've got some infomation about this, but i am not sure how to do it ,and i am not sure vc ++ 2005 whether can be used to accomplish it.

who can give me a example

really appreciate your help.



Re: Smart Devices VB and C# Projects how to package some function into DLL file prepare for c#

kevin_deng2008

I just want to invoke some funtion from TAPI.h , but the C# 2005 can not directly,

so , somebody help me expect your answer. if you don't mind, give me a example , better.

thank you very much





Re: Smart Devices VB and C# Projects how to package some function into DLL file prepare for c#

Ilya Tumanov

You¡¯d need to P/Invoke. See if signature for particular function and all structures it uses are available on http://www.pinvoke.net/ If not you¡¯d need to declare them yourself. Due to TAPI complexity this is a complex task. If you¡¯re not that P/Invoke savvy you might try OpenNetcf.org¡¯s TAPI wrapper.






Re: Smart Devices VB and C# Projects how to package some function into DLL file prepare for c#

Michael Koster

As Ilya already said - you need to use P/Invoke

The following resources show how to use it (including some samples):

http://msdn.microsoft.com/msdnmag/issues/03/07/NET/

http://msdn2.microsoft.com/en-us/library/aa446536.aspx