- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
c 中如何调用动态链接库dll(How to call dynamic link library DLL in c ).doc
c#中如何调用动态链接库dll(How to call dynamic link library DLL in c#)
Each programming language calls DLL methods are not the same, in this only for the use of C# call DLL method is introduced. First of all, you need to know what escrow is and what unmanaged is. It can be generally considered: unmanaged code is mainly based on win 32 platform developed DLL, activeX components, managed code is developed based on the.Net platform. If you want to thoroughly understand the relationship and difference between trusteeship and unmanaged, and their operating mechanism, please find the data yourself, this document is not discussed here.
(1) the general method of calling unmanaged functions in DLL
First, the external method should be declared in the C# language source program. The basic form is:
[DLLImport (DLL file)]
The modifier extern returns the variable type method name (parameter list)
Among them:
DLL file: a library file that contains an external method.
Modifiers: access modifiers, modifiers other than abstract, that can be used to declare methods.
Return variable type: in the DLL file, you need to call the return variable type of the method.
Method name: in the DLL file, you need to call the name of the method.
Parameter list: in the DLL file, you need to call the list of methods.
Note: you need to use the System.Runtime.InteropServices namespace in the program declaration.
DllImport can only be placed on the method statement.
The DLL file must be located in the current directory of the program or in the query path defined by the system (i.e., the path set by Path in the system environment variable).
The return variable type, method name, and parameter list must be consistent with the definition in the DLL file.
To use other function names, you can use the EntryPoint property settings, such as:
[DllImport (user32.dll, EntryPoint=, MessageBoxA)
Static extern int MsgBox (int hWnd, string MSG, string caption, int type);
Other optional DllImportAttribute attributes:
CharSet indica
您可能关注的文档
- 水分胁迫条件下复水对糜子叶片衰老与活性氧代谢的影响.doc
- 矩阵论文-共轭梯度法求解维纳霍夫方程.doc
- Eu 掺杂SrO-MgO-BO-SiO发光玻璃的一步法合成及其发光性能研究.doc
- 具有自修复功能的推力矢量飞机间接适应飞行控.doc
- 纤维素等离子改性.doc
- 甲醇及下游研究组王笑天电话-邮箱xiaotian.doc
- 相互作用专题8 受力分析 共点力的平衡学案答案2016.6.17.doc
- 第-章配合物和配位平衡.doc
- 不同磷脂配比构成的脂蛋白对j细胞胆固醇转运和sr-bi表达的影响.docx
- 有色金属行业:目前形势依然利于基本金属板块,继续关注碳酸锂及汽车尾气催化剂相应标的-月月度策略报告.doc
原创力文档


文档评论(0)