您好我有样品
#include "stdafx.h"
using namespace System;
ref class RefClass
{
public:
int X;
RefClass(int x)
{
X = x;
}
};
如何在Form1.h中使用此类?与RefClass^ d = gcnew WinFormsTest::RefClass();
public ref class Form1 : public System::Windows::Forms::Form
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
}
第二,我应该在.h中放置RefClass代码?还是.cpp?
答案 0 :(得分:1)
auto refClass = gcnew RefClass();