C#响应ATL事件回调示例代码

时间:2018-11-01 14:24:34
【文件属性】:

文件名称:C#响应ATL事件回调示例代码

文件大小:2KB

文件格式:CS

更新时间:2018-11-01 14:24:34

C# Atl事件回调

private void button1_Click(object sender, EventArgs e) { try { TGOpenApiCtrl tg = new TGOpenApiCtrl(); _ITGOpenApiCtrlEvents_TGOpenApiCallbackEventHandler cb = new _ITGOpenApiCtrlEvents_TGOpenApiCallbackEventHandler(this.EventCallback); tg.TGOpenApiCallback += cb; tg.Init("1111563433", "7738fdd1881372ae2b48018924a1febd", null, null); } catch (Exception ex) { string msg = ex.Message; } } private void EventCallback(int eventID, int errorCode, string result) { try { this.SetText("eventID:" + eventID.ToString() + "\nerrorCode:" + errorCode.ToString() + "\nResult:" + result); } catch (Exception ex) { string msg = ex.Message; } }


网友评论