English 中文(简体)
返回到C#
原标题:Keep the class state in C++ after Returning to C#

我有一张C++作为背书和C#作为前端,我利用pin湖间机制,在本地和管理的法典之间进行沟通。

现在的问题是,C++的后端、初始阶段和计算部分实际做了两部分计算。 初步化只需要一次,但需要很长的时间才能进行,而由来得起的那部分只是花了很短的时间才能完成,但需要再做。

而C++的编码将按其现在和现在可以改写为C#代码。

我可以修改C++和C#代码,因为我掌握这些编号。

我知道如何静态地进行互操作,但我不知道如何进行这种类型的州际交流。 任何想法?

最佳回答

你可以在C++/CLI的C++级左右写一个包裹,从而提供真正的CLR类型。 你们不能无缝地管理C#的生命周期。

  • There is quite some information on the web for it: here or here (just google "C++/CLI wrapper").
  • And, naturally, on stackoverflow: here.

除非有某种礼貌工具,否则,你必须写这张画面。

或者,你可以围绕你的C++级撰写一个包装功能(或一套功能),可能只能将最低要求的功能作为“C”功能。 然后,你会把“能力”(Int32, IntPtr, 不管怎样)排除在无功能状态之外,并要求它作为辅助功能的投入。 你们必须在内部履行总结职能(或许也希望提供清理功能)。

问题回答

暂无回答




相关问题
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. ...

热门标签