架构深渊

慢慢走进程序的深渊……关注领域驱动设计、测试驱动开发、设计模式、企业应用架构模式……积累技术细节,以设计架构为宗。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2009年1月6日

摘要: 我们知道为了让DLL导出一些函数,需要在每一个将要被导出的函数前面添加标识符:_declspec(dllexport).例如在DLL中可以导出这样的函数(方法) #define DLL1_API _declspec(dllexport) DLL1_API int Add(int a,int b) { return a+b; } 如果你想查看你的DLL的导出情况可以这样做,在你的VC安装目录下... 阅读全文

posted @ 2009-01-06 23:52 chen eric 阅读(3954) 评论(1) 推荐(0) 编辑

摘要: dll的导出 解决函数名称改写带来的问题 因为C++要支持函数重载功能,所以实际编译时会对函数的名称进行改写。 所以我们要加extern "C"来修饰一个函数,让该函数不被重写。 但是,如果使用标准调用方式__stdcall来修饰的函数即使使用了extern "C"来限定,仍然会把名字进行改写,这个时候可以使用def模块定义文件来限定函数的名称,不让编译器进行改写。 几种情况: 1 名字被... 阅读全文

posted @ 2009-01-06 23:31 chen eric 阅读(603) 评论(0) 推荐(0) 编辑

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->C# 和 API2008-04-01 13:17API (Application Programming Interface) is a set of commands, which interfaces... 阅读全文

posted @ 2009-01-06 22:54 chen eric 阅读(325) 评论(0) 推荐(0) 编辑

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->提供 .Net 下调用非托管Dll内部函数 的快捷方法2008年12月12日 星期五 下午 10:241,用C#实现一个DllImported 类,内部利用DllImport 访问kernel32.dll... 阅读全文

posted @ 2009-01-06 22:42 chen eric 阅读(362) 评论(0) 推荐(0) 编辑

摘要: Code Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->一、发生的背景 在开发新项目中使用了新的语言开发 C# 和新的技术方案 WEB Service,但是在新项目中,一些旧的模块需要继续使用,一般是采用 C 或 C++ 或 Delphi... 阅读全文

posted @ 2009-01-06 19:09 chen eric 阅读(230) 评论(0) 推荐(0) 编辑

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->摘 要:在《csdn开发高手》2004年第03期中的《化功大法——将DLL嵌入EXE》一文,介绍了如何把一个动态链接库作为一个资源嵌入到可执行文件,在可执行文件运行时,自动从资源中释放出来,通过... 阅读全文

posted @ 2009-01-06 19:05 chen eric 阅读(234) 评论(0) 推荐(0) 编辑

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->上网baidu一下或google一下这个东东就有很多人在问这个问题,最近我也用到了这个,所以就留下来以备往后需要是可以查找。在调用非托管 DLL的APIs前,我们应该好好掌握一下DllImpor... 阅读全文

posted @ 2009-01-06 18:38 chen eric 阅读(269) 评论(0) 推荐(0) 编辑

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->如何逐步实现动态库的加载,类型的匹配,动态链接库函数导出的定义,参考下面宏定义即可: #define LIBEXPORT_API extern "C" __declspec(dllexport... 阅读全文

posted @ 2009-01-06 18:27 chen eric 阅读(605) 评论(0) 推荐(0) 编辑