Link to home
Start Free TrialLog in
Avatar of CURRYFREE1983
CURRYFREE1983

asked on

Working with C dll

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
      {
            
            [DllImport("Caspian1.dll")]
            public static extern string test();
               }


textBox4.Text = Win32.test();


Any advice at all would be greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of novitiate
novitiate

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial