为了账号安全,请及时绑定邮箱和手机立即绑定

关于调用com组件的问题

关于调用com组件的问题

米脂 2018-11-20 05:02:13
com组件名称 s.dll包含方法签名如下int CreateKey(char* dkey, int dkeyLen, char* ekey, int ekeyLen);c#这样调用[DllImport( "s.dll" , EntryPoint="CreateKey" ,CharSet = CharSet.Ansi)]public static extern int CreateKey(out string decryptKey , int decryptKeyLen ,out string encryptKey , int encryptKeyLen );调用代码如下:string dkey = "";string ekey = "";int dlen = 32;int elen = 32;CreateKey(out dkey, dlen, out ekey, elen); 看起来似乎正确,调用的时候确报如下错误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 回答

?
幕布斯7119047

TA贡献1794条经验 获得超8个赞

把dll传上来看看

查看完整回答
反对 回复 2018-11-21
  • 2 回答
  • 0 关注
  • 465 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号