請問我在c#中用動態(tài)鏈接庫的方式引入一個c++dll,在調用dll中的接口時,入?yún)㈩愋拖襁@樣轉換是否正確?依照這個dll的接口文檔描述,它這個接口的入?yún)⑹沁@樣的:long OltpTransData(unsigned long msgType,unsigned long packageType,unsigned long packageLength,char *str,LPTSTR com); c#代碼中的引入,我是這么寫的:
[DllImport("OltpTransIc1701.dll", SetLastError = false)]
public static extern long OltpTransData(long msgType, long packageType, long packageLength, ref string str, [MarshalAs(UnmanagedType.LPTStr)] string com);
請問這么轉換入?yún)㈩愋褪欠裾_?
請問我在c#中用動態(tài)鏈接庫的方式引入一個c++dll,入?yún)㈩愋拖襁@樣轉換是否正確?
慕田峪4524236
2018-10-30 05:05:40