处理C#在C ++中引发的事件 [英] Handle event raised by C# in C++

查看:84
本文介绍了处理C#在C ++中引发的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JNI来监听C#中引发的事件,因为java不会直接与C#对话,我正在考虑用C ++写一些东西来处理C#提出的偶数问题,并将其传递给Java.可行吗?我该如何处理C ++中的C#事件? Thx ..

I am using JNI to listen to an event raised in C#, since java doesn't talk to C# directly,  i was thinking about write something in C++ to handle the even raised by C# and pass it to java. Does it doable? How can i handle the C# event in C++? Thx..

推荐答案

使用/clr 向C#库添加引用,创建相关对象的实例,并连接一个事件处理程序(语法在 这个旧线程).
Compile with /clr, add a reference to the C# library, create an instance of the relevant object, and wire up an event handler (syntax is demonstrated in this old thread).


这篇关于处理C#在C ++中引发的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆