怎样调用.dll动态库?

yingyuehen 2006-08-29 11:03:19
我想操作一个设备,设备提供商提供了一个.dll动态库,我调用这个动态库
[DllImport("Rapi.dll", EntryPoint = " NLS_RapiInit ", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern int NLS_RapiInit (int nPort, int nRate, bool bCompress);
Rapi.dll是动态库名称,int NLS_RapiInit (int nPort, int nRate, bool bCompress);是函数名称。
我调用这个函数NLS_RapiInit (1, 115200, true);结果出现错误“Unable to find an entry point named ' NLS_RapiInit ' in DLL 'Rapi.dll'.”
这可能是什么原因呢,请各位高手帮忙
...全文
126 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yingyuehen 2006-08-29
  • 打赏
  • 举报
回复
动态库应该是没问题,我用VC调用了一下都没问题的,可能是什么原因呢?各位帮忙看看呗

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧