[问题] Web API 2 DllImport失败疑问

楼主: james999 (无伤大雅)   2017-12-06 18:14:32
今日用Web API 2调用C wrapper的dll库,
但是发现调用到接口函数时,程序就卡住了,
尝试把参数EntryPoint改成不存在函数名称时,
也是直接卡住,而不是报入口不存在...
不太确定是哪里有误,想请板上前辈指导,谢谢。
[DllImport(@"dllTest3.dll", EntryPoint = "initRtspServer", CharSet =
CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int initRtspServer(ushort port);
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
ushort portGo = 3356;
int abc = initRtspServer(portGo);
楼主: james999 (无伤大雅)   2017-12-07 21:11:00
问题已解决!Windows不能在加载dll时建立线程.

Links booklink

Contact Us: admin [ a t ] ucptt.com