码迷,mamicode.com
首页 > 其他好文 > 详细

DllImport使用

时间:2017-11-30 13:34:22      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:ror   ros   window   dll   ati   imp   环境   sys   span   

1.Dll引用路径

  (1)exe运行程序所在的目录

  (2)System32目录

  (3)环境变量目录

  (4)自定义路径,如:DllImport(@"C:\OJ\Bin\Judge.dll")

 

2..DllImport用法

[DllImport("User32.dll")]
private static extern IntPtr GetWindowDC(IntPtr hwnd);  //找到User32.dll后直接调用其中的GetWindowDC()方法


[DllImport("User32.dll")]
private static extern int ReleaseDC(IntPtr hwnd, IntPtr hdc);


[DllImport("Kernel32.dll")]
private static extern int GetLastError();

 

DllImport使用

标签:ror   ros   window   dll   ati   imp   环境   sys   span   

原文地址:http://www.cnblogs.com/AlexOneBlogs/p/7928212.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!