1

プレーンな 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)..
    };
}
4

3 に答える 3

1

gcnewCLI C++ で .NET オブジェクトを作成する場合に使用する必要があります。

于 2012-09-06T08:53:07.003 に答える
0
ref class Student
{
    ...
};

...

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

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

于 2012-09-25T10:14:11.163 に答える
0

例を見つけました。ネイティブ C++ アプリケーションで .NET アセンブリを使用する

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

C# Crystal Reports プロジェクトを作成する場合は、この例を使用できます。(一部変更あり)

于 2012-09-28T09:00:17.447 に答える