This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 请教高手关于C#调用DLL哪位.net高手开发过此方面的应用?我是才涉及到这个问题,很陌生啊。
而且对DLL也不是很熟悉。我用Add Reference的方式,在MS Visual .net 2003中,试图加入dll文件,无论是WindowsXP自带的dll文件,还是我用VC6写的dll,都不能同Add Reference的方式打开,提示说不是有效的com组件之类的错误信息。但是我看了很多资料,都接收了Add Reference这种方式是可以的。
难道是我的ms visual .net 2003有问题?
多谢指教!
-tony_yang(月饼);
2005-10-19
{394}
(#2562292@0)
-
no, u have to use [DLLImport(......)] in the code.
-binghongcha76(一只大猫);
2005-10-19
(#2562362@0)
-
this is a sample, suppose u want to let Windows do a beep[DllImport("kernel32.dll")]
private static extern bool Beep(int freq, int dur);
[STAThread]
static void Main(string[] args)
{
Beep(800, 200); // to let windows beep by using dll function
}
by the way, I am not 高手, it's just some very basic knowledge of .net
-binghongcha76(一只大猫);
2005-10-19
{278}
(#2562420@0)