com組件名稱 s.dll包含方法簽名如下int CreateKey(char* dkey, int dkeyLen, char* ekey, int ekeyLen);c#這樣調(diào)用[DllImport( "s.dll" , EntryPoint="CreateKey" ,CharSet = CharSet.Ansi)]public static extern int CreateKey(out string decryptKey , int decryptKeyLen ,out string encryptKey , int encryptKeyLen );調(diào)用代碼如下:string dkey = "";string ekey = "";int dlen = 32;int elen = 32;CreateKey(out dkey, dlen, out ekey, elen); 看起來(lái)似乎正確,調(diào)用的時(shí)候確報(bào)如下錯(cuò)誤Additional Information: The runtime has encountered a fatal error. The address of the error was at 0x79e71bd7, on thread 0x7b0. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.郁悶...
- 2 回答
- 0 關(guān)注
- 492 瀏覽
添加回答
舉報(bào)
0/150
提交
取消