Reputation: 874
Hello I have sample
#include "stdafx.h"
using namespace System;
ref class RefClass
{
public:
int X;
RefClass(int x)
{
X = x;
}
};
How can I use this class in Form1.h? Like 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) {
}
2nd Where i should place RefClass code in .h? or .cpp?
Upvotes: 1
Views: 2017
Reputation: 35136
auto refClass = gcnew RefClass();
Upvotes: 1