請問我在c#中用動態鏈接庫的方式引入一個c++dll,在調用dll中的接口時,入參類型像這樣轉換是否正確?依照這個dll的接口文檔描述,它這個接口的入參是這樣的: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);
請問這么轉換入參類型是否正確?
請問我在c#中用動態鏈接庫的方式引入一個c++dll,入參類型像這樣轉換是否正確?
慕田峪4524236
2018-10-30 05:05:40
