[問題] Web API 2 DllImport失敗疑問

看板Web_Design作者 (無傷大雅)時間7年前 (2017/12/06 18:14), 編輯推噓0(001)
留言1則, 1人參與, 7年前最新討論串1/1
今日用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); -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 122.116.193.176 ※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1512555275.A.E55.html

12/07 21:11, 7年前 , 1F
問題已解決!Windows不能在載入dll時建立線程.
12/07 21:11, 1F
文章代碼(AID): #1Q9yCBvL (Web_Design)
文章代碼(AID): #1Q9yCBvL (Web_Design)