Crystal Reports — Как получить доступ к классу Cli в C ++?

Мне нужно сделать новый объект класса cli в простом коде C ++.

Я новичок в кли, пожалуйста, помогите

мой класс 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)..
};
}

1

Решение

Вам нужно использовать gcnew если вы хотите создать .NET объект в CLI C ++.

1

Другие решения

ref class Student
{
...
};

...

Student^ student = gcnew Student();
student->SelectSubject("Math", 97);

Ref:
http://www.codeproject.com/Articles/17787/C-CLI-in-Action-Instantiating-CLI-classes

0

Я нашел пример. Используйте сборки .NET в собственных приложениях C ++

http://msdn.microsoft.com/en-us/vstudio/bb892742.aspx

Если вы создаете проект C # Crystal Reports, вы можете использовать этот пример.
(с некоторыми изменениями)

0