arlyxiao / best-practice

1 stars 0 forks source link

windows ways #100

Open arlyxiao opened 1 year ago

arlyxiao commented 1 year ago

Build dll for windows

https://nullprogram.com/blog/2021/05/31/

C# can't call method with string directly https://stackoverflow.com/questions/14953180/calling-c-dll-functions-returning-char-from-c-cannot-use-dllimport

IntPtr verText = f1();
string s = Marshal.PtrToStringAnsi(verText);
Console.WriteLine(s);