作者silveryfox99 (银狐)
看板C_Sharp
标题Re: [问题] dll的使用?
时间Wed Nov 21 17:30:14 2007
※ 引述《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