return string to .Net application from c dll ?

  • Thread starter Thread starter Daylor
  • Start date Start date
D

Daylor

how can i return string to .Net application from c dll ?

i have the text in
char sText[100] ;

and i want to return it from c dll to .Net application.

i tried : *char in the function, but the didnt saw the string i passed.

what type/way i need to do ?



thanks and have a nice day.
 
In .Net routine use
[return: MarshalAs(UnmanagedType.LPStr)]
public static extern string MyMethod(...)

In C char* MyRoutine(...);
 
Back
Top