I have a static library. This library have the following function defined
int WriteData(LPTSTR s)
The sample to call the function is
Try:
[DllImport("Test.dll")] private static extern int TestFun([MarshalAs(UnmanagedType.LPTStr)] string s);
More information on marshaling with the MarshalAsAttribute on MSDN.