首页 > 其他 > 详细

c#回调函数写法

时间:2014-02-20 00:42:40      阅读:583      评论:0      收藏:0      [点我收藏+]
添加一个cs文件,在里面定义回调
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.InteropServices;
 
namespace GotecomBigDipper
{
    [ Serializable ]
    [ ComVisible (true )]
    public delegate void RS_DATA_CALLBACK (System.UInt32 _WPARAM, System. Int32 _lParam);
}
在其他地方声明一个函数
  public extern static bool RSDataCallBack( RS_DATA_CALLBACK callback);
回调函数的具体实现如下
private void sdkCallback(System. UInt32 _WPARAM, System. Int32 _lParam)
        {
            for (int i = 0; i <= 1; i++)
            {
                _WPARAM = WPARAM[i];
                lParam[i] = _lParam;
            }
 
        }
 
最终回调被调用时可以如下:
GetSdkBLL .RSDataCallBack(sdkCallback);

c#回调函数写法

原文:http://www.cnblogs.com/huxu/p/3556064.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!