English 中文(简体)
C++ 处理C#活动
原标题:C++ to C# event handling

因此,我来临<>C#。 WinForm Application, from it 我请我的C++ CLI MFC dll图书馆发言。

但是,在我的C++图书馆有一些events,即便是在该图书馆的本土(非CLI)部分发生的事件。 我需要从我的C#应用中提一下某些代码,并在此获得一些数据。

因此,当这一本土职能从客户方面起时:

bool __stdcall ClassName::WorkQuery()
{
         ......
        switch(pp->code)
        {
        case READCOMPLEX:
                       ..........

我需要从C#获得数据。 我需要将此登记为某种活动。

最佳回答

So the problem is you need to run C# code in response to MFC event (or C++ callback), right?

为什么只能把一名土著手登记到土著活动/召回处,然后才援引“网络”活动,这种活动可以是C#的消费。

问题回答

你们可以从C++/CLI活动中产生网络活动,然后从本土上加以利用。 Just use eventWaitHandle or the derived AutoResetEvent and ManualResetEvent.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...