看板 C_Sharp 關於我們 聯絡資訊
※ 引述《silveryfox99 (銀狐)》之銘言: : ※ 引述《toki (いまがその時だ)》之銘言: : : 這個是給 COM/ActiveX 物件用的,對一般 DLL 而言,這個指令沒有意義 : : 那個 dll 的 document 有要求你要先執行這個命令? : 無 : dll的document裡使用的方法是Visual Studio 6.0 : To set 'Code Generation' option: : 1. In Project Settings (Alt+F7), choose the 'C/C++' tab : 2. In the 'Category' combo box, select 'Code Generation'. : 3. In the 'Use run-time Library' set the option according to the table below. : To set the preprocessor flags: : 1. In Project Settings (Alt+F7), choose the 'C/C++' tab : 2. In the 'Category' combo box, select 'Preprocessor'. : 3. In the 'Preprocessor definitions' add the preprocessor flag. : 而小弟使用的是vs2005 : : Try google "c# dllimport",但是你必需先擁有這個 dll 裡面 function 的宣告 : func宣告已有﹐只是找不到能夠使用這個dl的方法 推 horngsh:DLL檔的路徑有寫對嗎? 要用@"X:\dir\test.dll"不然要用雙\ 11/21 17:00 小弟的DIIImport用法 namespace AuthSSEP { public class testDLL { [DllImport("test.dll", EntryPoint = "test_init")] public static extern void test_init(); } 看了horngsh版友的推文後 去測試了一下 [DllImport(@"D:\test.dll", EntryPoint = "test_init")] public static extern void test_init(); complier就過了﹐真是感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.243.151.204