相关文章  
  • 重要文件的铠甲:EFS加密
  • Windows2000支持的几种文件系统与比较
  • 你真的了解windows的自启动方式吗?
  • C# 中数组和类型转换的功能实现
  • 如何优化 Tablet PC 的功能应用程序
  • 为 Windows XP Embedded 创建自定义组件
  • 企业用户应当如何利用Windows XP SP2
  • 将现存的信息系统移植到组件化架构
  • 应用程序互操作性:互用性基本原理
  • 动态汉化Windows技术的一些简要分析
  •   推荐  
      科普之友首页   专利     科普      动物      植物        天文   考古   前沿科技
     您现在的位置在:  首页 >>文献 >>培训

    C#中调用带回调函数和自定义结构体的DLL例程2

    , unsigned char uchFeeusertype, LPCTSTR pchFeeterminalid, unsigned char uchTppid, unsigned char uchTpudhi, unsigned char uchMsgfmt, LPCTSTR pchMsgsrc, LPCTSTR pchFeetype, LPCTSTR pchFeecode, LPCTSTR pchValidtime, LPCTSTR pchAttime, LPCTSTR pchSrcid, unsigned char uchDestusrtl, LPCTSTR pchDestterminalid, unsigned char uchMsglen, LPCTSTR pchMsgcontent);
      DllExport int __stdcall Cmpp2Release();
      在C#里面如何调用API,如何声明结构体,如何使用委托实现回调函数,如何实现使用自定义结构体作为参数的回调函数,请仔细查看例程源码。注意:CMPPAPI.dll要和可执行文件放到同一个目录下,或者放到可执行文件能找到的目录,或者放到系统目录下(如:C:\windows\system32).
      
      下面是C#下面的完整的调用代码
      
      //Class1.cs
      
      using System;
      // 该名称空间包含了在Visual C#中调用API的一些必要集合
      using System.Runtime.InteropServices;
      // 使用Sleep方法需要的命名空间
      using System.Threading;
      
      namespace CMPPAPI_Sample_CS

    页码:[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]2页、共10页

         

          设为首页       |       加入收藏       |       广告服务       |       友情链接       |       版权申明      

    Copyriht 2007 - 2008 ©  科普之友 All right reserved