DllImportAttribute 类
来源:互联网 发布:淘宝买车分期付款 编辑:程序博客网 时间:2024/06/07 01:39
原文链接:https://msdn.microsoft.com/zh-cn/library/system.runtime.interopservices.dllimportattribute(v=vs.100).aspx
指示该特性化方法由非托管动态链接库 (DLL) 作为静态入口点公开。
哇,这句话好绕啊,头都大了。
下面的代码示例演示如何使用 DllImportAttribute 属性导入 Win32 MessageBox 函数。然后,代码示例将调用导入的方法。
using System;using System.Runtime.InteropServices;class Example{ // Use DllImport to import the Win32 MessageBox function. [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern int MessageBox(IntPtr hWnd, String text, String caption, uint type); static void Main() { // Call the MessageBox function using platform invoke. MessageBox(new IntPtr(0), "Hello World!", "Hello Dialog", 0); }}
阅读全文
0 0
- DllImportAttribute 类
- DllImportAttribute.EntryPoint 字段
- DllImportAttribute 常用知识介绍
- c#中DllImportAttribute用法汇总
- c#中DllImportAttribute用法汇总
- c#中DllImportAttribute用法汇总
- 类
- 类
- 类
- 类
- 类
- 类
- 类
- 类
- 类
- 类
- 类
- 类
- unity的canvas scaler组件
- Python--sys模块
- unity 中将c#打包成dll中,需要注意的地方
- 深入Android 【四】 —— 组件调用
- SpringBoot 定时任务踩坑记录
- DllImportAttribute 类
- 系统总线(二)
- Eigen 求解线性方程组
- 使用kickstart创建逻辑卷管理LVM分区
- 阿里云maven仓库
- spring aop 注解以及各种织入点语法
- 《算法图解》第四章快速排序
- Python--command模块
- js如何准确获取当前页面url网址信息