码迷,mamicode.com
首页 >  
搜索关键字:dllimport    ( 445个结果
VS下 dllimport与dllexport作用与区别
我相信写WIN32程序的人,做过DLL,都会很清楚__declspec(dllexport)的作用,它就是为了省掉在DEF文件中手工定义导出哪些函数的一个方法。当然,如果你的DLL里全是C++的类的话,你无法在DEF里指定导出的函数,只能用__declspec(dllexport)导出类。但是,MS...
分类:其他好文   时间:2014-11-24 18:33:36    阅读次数:160
C# 带滚动条的Label控件
C# 带滚动条的Label控件,用鼠标选的时候还是有点闪烁:namespace 带滚动条的Label控件 { public class TextBoxLabel : System.Windows.Forms.TextBox { [DllImport("user32", EntryPoint = "HideCaret")] private static...
分类:Windows程序   时间:2014-11-17 17:49:51    阅读次数:306
C# DllImport的用法
大家在实际工作学习C#的时候,可能会问:为什么我们要为一些已经存在的功能(比如Windows中的一些功能,C++中已经编写好的一些方法)要重新编写代码,C#有没有方法可以直接都用这些原本已经存在的功能呢?答案是肯定的,大家可以通过C#中的DllImport直接调用这些功能。DllImport所在的名...
分类:Windows程序   时间:2014-11-17 17:15:27    阅读次数:346
C#调用C++dll
1.添加命名空间 using System.Runtime.InteropServices;2.dll的添加和函数的声明(注意一定要放在函数(方法)的外面) [DllImport("User32.dll")]public static extern int MessageBox(int h, s.....
分类:编程语言   时间:2014-11-17 13:58:37    阅读次数:141
C# 实现无焦点窗体(转载)
#region 无焦点窗体 [System.Runtime.InteropServices.DllImport("user32.dll")] private extern static IntPtr SetActiveWindow(IntPtr handle); priv...
分类:Windows程序   时间:2014-11-13 18:08:56    阅读次数:267
C#调用C接口字符参数编码的问题解决方法
1、传入单字节ANSI字符 [DllImport("hostIO", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]     public static extern int initHost([MarshalAs(UnmanagedType.LPStr)] string host); 2、传...
分类:Windows程序   时间:2014-11-13 16:47:12    阅读次数:280
浅谈__declspec(dllexport)和__declspec(dllimport)
__declspec(dllimport)和__declspec(dllexport)经常是成对的,在动态链接库中__declspec(dllexport)导出dll中的成员,__declspec(dllimport)导入外部dll中的成员。但是有时候不使用dllimport和dllexport也能...
分类:其他好文   时间:2014-11-08 23:27:34    阅读次数:293
C#给其他程序发消息
1、相关声明函数,SendMessage可定义两种格式。[DllImport("User32.DLL", CharSet = CharSet.Auto)]public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndCh...
分类:Windows程序   时间:2014-11-01 19:03:58    阅读次数:212
封装短信猫,dell类库生成,在vs2008中创建类库项目.并在mobilesp中建立pulbic类型的gms类.
usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Runtime.InteropServices;namespaceMobileSP{publicclassGMS{//codego.net初始化gsmmodem,并连接gsmmodem[DllImport("dllforvc.dll",EntryPoint="GSMModemInitNew",CharSet=CharSet.Ansi,CallingCon..
分类:其他好文   时间:2014-11-01 12:02:53    阅读次数:187
判断窗体是否最小化和最大化
[DllImport("user32.dll")] public static extern bool IsIconic(IntPtr hwnd); [DllImport("user32.dll")] public static extern bool Is...
分类:Windows程序   时间:2014-10-29 00:07:54    阅读次数:192
445条   上一页 1 ... 35 36 37 38 39 ... 45 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!