如何在c++中访问cli类
How to access a cli class in c++?
我需要在纯C++代码中创建一个cli类的新对象。
我是cli的新手,请帮助
我的cli类:
using namespace System;
using namespace System::Windows::Forms;
using namespace CrystalDecisions::Shared;
using namespace CrystalDecisions::CrystalReports::Engine;
using namespace CrystalDecisions::Windows::Forms;
namespace CrystalRapport {
// This is the main form that will hold the viewer control.
ref class ViewForm : public System::Windows::Forms::Form
{
private:
//Declare the Viewer Control, Report Document, and other
//objects needed to set the connection information.
public:
ViewForm()..
void InitForm()..
//This function initializes the form and adds the viewer to the form.
void ViewForm_Load(System::Object^ sender, System::EventArgs^ e)..
};
}
如果要创建,则需要使用gcnew
。NET对象。
ref class Student
{
...
};
...
Student^ student = gcnew Student();
student->SelectSubject("Math", 97);
参考编号:http://www.codeproject.com/Articles/17787/C-CLI-in-Action-Instantiating-CLI-classes
我找到了一个例子。使用NET程序集在本机C++应用程序中的应用
http://msdn.microsoft.com/en-us/vstudio/bb892742.aspx
如果您创建了一个C#Crystal Reports项目,您可以使用此示例。(有一些变化)
相关文章:
- 通过方法访问结构
- 使用不带参数的函数访问结构元素
- 如果我只是不访问queue_front节点的子节点,而是将它们推到队列中呢?还是BFS吗
- 用于访问容器<T>数据成员的正确 API
- 访问者访问变体并返回不同类型时出错
- 尝试通过多个向量访问变量时,向量下标超出范围
- 无法访问嵌套类.类的使用无效
- C++/CLI -- 访问结构成员
- C++/CLI访问字符串::来自非CLI代码的格式
- 在 CLI 中抛出 std::exception 会引发访问冲突
- 附加到 C++/CLI dll 的性能探查器无法访问本机C++代码
- 创建具有root访问权限的CLI应用程序
- 如何在c++中访问cli类
- 访问 C++/CLI 包装器中的私有C++方法
- 从C++/CLI 托管访问 C# 重载方法
- C++ CLI 访问类中的表单变量
- 添加使用 c#(或 c++/cli)访问 vba 的功能
- CLI/ c#类中属性的特殊访问控制
- c++ /CLI双指针类型转换为ref IntPtr,用于c#访问
- C#-无法访问C++/CLI.dll中包含的方法