2014年6月20日

#pragma

摘要: once头文件被编译一次。就能够保证头文件只被编译一次warning(disable:1111) 不报(once:1111)报一次( error:1111)报comment传统的到出 DLL 函数的方法是使用模块定义文件 (.def),Visual C++ 提供了更简洁方便的方法,那就是“__dec... 阅读全文

posted @ 2014-06-20 17:06 shoutcharter 阅读(114) 评论(0) 推荐(0) 编辑

创建C#DLL

摘要: 1. 创建classlibrary2.编写一个COM接口和一个COM类 [Guid("DBE0E8C4-1C61-41f3-B6A4-4E2F353D3D05")] public interface IManagedInterface { int PrintHi(string name); }... 阅读全文

posted @ 2014-06-20 16:55 shoutcharter 阅读(183) 评论(0) 推荐(0) 编辑

C#中类的属性

摘要: 1.【StructLayout】控制类或结构的数据字段在托管内存中的物理布局,即类或结构需要按某种方式排列。如果要将类传递给需要指定布局的非托管代码,则显式控制类布局是重要的。2.[MarshalAs]告诉CLI,这个函数返回值占几个字节1和2用于C#调用C++的DLL3.__declspec(dl... 阅读全文

posted @ 2014-06-20 15:11 shoutcharter 阅读(255) 评论(0) 推荐(0) 编辑

导航