积极答复者
unable to load dll 'rapi.dll' 找不到指模块?

问题
-
[DllImport("rapi.dll", CharSet = CharSet.Unicode)]
internal static extern int CeRapiGetError();
[DllImport("rapi.dll", CharSet = CharSet.Unicode)]
internal static extern int CeRapiInit();
public void RapiInit()
{
int ret = CeRapiInit();
if( ret != 0)
{
// 连接失败,获取失败代码
int e = CeRapiGetError();
// 抛出异常
Marshal.ThrowExceptionForHR(ret);
}
// 连接成功 // To Do
}int ret = CeRapiInit(); 这行报错!!
system32目录下有rapi.dll
顺便问下是不是没有连接设备导致错误的?
全部回复
-
你好 潘基文,
根据您的代码和错误提示,很有可能是rapi.dll的问题。
建议您再次下载安装
Download details: Microsoft Windows Mobile Device Center 6.1 for Windows Vista (32-bit)
另外这个错误跟没有链接设备是没关系的。
建议你去这个站点问相关的问题,您会得到更多帮助的。
如果有什么问题,欢迎再次来MSDN 中文论坛。
Rocky
Rocky Yue[MSFT]
如果您对我们的论坛在线支持服务有任何的意见或建议,请通过邮件告诉我们。
立刻免费下载 MSDN 论坛好帮手 -
很可能是安装其他软件的时候,有同名的dll文件,覆盖了rapi,你重新安装下试试。
Rocky Yue[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
可以的,你可以试下看看结果先。
有什么问题在贴上来,大家给你点建议。
Best Regards,
Rocky Yue[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
能分享一下解决方案吗?
amazing.
Best Regards,
Rocky Yue[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.