Working with C dll
Posted on 2005-04-12
I have an apllication that has been written as a dos based command driven interface in c code. I am trying to redesign the interface within the .net environment. I have created a dll with the existing c source code and have exported the necessary functions that I need to interact with the interface. I was using c#.net for testing if I could pass between the dll and the new interface. Integers are passing find but I am having problems with the strings as c defines these as chars and c++ c#.net refer to them as string types. I was hope to pass these as values, but maybe it would be possible using pointers?
Below shows some of the coding I have tried in c#.net.
public class Win32
public static extern string test();
textBox4.Text = Win32.test();
Any advice at all would be greatly appreciated.