[問題] 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