Question:
how to call a C# dll function from a C code ?
Tohoru san
2009-11-14 19:22:50 UTC
hello ,

i have written dll with C# that stores two functions (GetString & SetString)

how can i call SetString function from a C code ??
Three answers:
Marc
2009-11-17 10:16:56 UTC
To call a "managed" .NET dll from native code you'll need to use COM and expose a public interface from your .NET code:



How to call a managed DLL from native Visual C++ code

http://support.microsoft.com/kb/828736
shandrio
2009-11-16 16:08:11 UTC
Hi Tohoru,



You can try the code on the folowing example: http://www.goffconcepts.com/techarticles/development/cpp/calldll.html



I think you can treat "C# Strings" as if they where char* types.

Don't forget to include for the above example to work.



I hope that helps!
Germann A
2009-11-18 03:49:16 UTC
http://www.google.co.uk/search?hl=en&client=firefox-a&rls=org.mozilla:en-US:official&hs=VqO&ei=GN8DS-z8EOahjAeP9NGBCw&sa=X&oi=spell&resnum=0&ct=result&cd=1&ved=0CA4QBSgA&q=c+call+function+from+dll&spell=1


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...