English 中文(简体)
C++/CLIlib, 1功能不变地与本土C++连接
原标题:C++/CLI lib with 1 function to be statically linked with native C++

I would like to accomplish a simple task: I want to produce a C++/CLI lib that calls some .NET routines, and exposes 1 static method that I can call from purely native C++ app. I want to statically link to that lib from my native app. The signature of the method that the native C++ app would call should be

void (unsigned char* data, int length, _TCHAR* args[])

总的来说,对C++/CLI和C++来说,我很新。 因此,请帮助我回答这些问题:

  1. 就我的C++/CLI项目而言,我假定类型需要成为具有产出的校准图书馆,以5c9为学期(因此,我可以确信可在终端用户PC上查阅)。 我对这一假设是否正确?

  2. 您能够提供这一签名方法概要的例子,我需要在我的C++/CLI项目中书写。 尤其是,我应如何适当(即按批发、编造32和铺设)向《刑法》类转变? 我如何用诸如“母体”__declspec(dllexport)”等某种东西来贬低这一方法,使这一方法能够从我的原居地C++中加以使用?

  3. 我如何在C++/CLI中妥善地将编码与档案分开?

  4. 最后,在我增加平衡点之后,我如何从我的本土记忆中把它说出来?

谢谢。

最佳回答
  1. 班级图书馆:正确,但还需要将贵项目组合类型从动态图书馆改为法定图书馆。 我不敢确定你以假日为攻击目标意味着什么——你需要把同使用你固定图书馆的本地法典放在同一时间。

  2. 由于这是一个固定的图书馆,不需要<代码>-declspec(dllexport)。 如果你想知道如何转换为......。 互联网类型,你需要张贴你守则的实际内容。 总的来说,你想要:Marshal:Copy将C-array复制成一个>NET阵列,>>>>>>>> 规范规范>salsals_t to C&en/>。 Net strings, 但仍然有这样一个问题,即这一数据是否意在变幻不定,在返回之前必须重新打回原地。

  3. 与C++——头盔申报的准确相同,在源文档中定义。

  4. 页: 1 声明的负责人称职。

问题回答

暂无回答




相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

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. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...