I know there are already tons of question similar to this, but i can't solve my problem.
I wrote this little code in Visual C++
#pragma once
using namespace System;
namespace MyWrapper {
public ref class MySubClass{
String^ username;
String^ password;
};
public enum class MyEnum{
VALUE1 = 1,
VALUE2 = 2,
VALUE3 = 3,
VALUE4 = 4
};
public ref class MyClass{
String^ string1;
String^ string2;
String^ string3;
long exampleNumber;
MyEnum choosenValue;
MySubClass credentials;
unsigned int otherNumber;
};
}
MyClass is a struct used in a external dll and i wrote this looking at the dll's source code. It compile and i can see it from my C# code, this C# code works:
MyClass instance = new MyClass();
but this doesn't work:
instance.string1 = "test";
it can't find string1 inside MyClass. string1 is just an example, i can't see any of the values i need. What i'm doing wrong?
property- How to: Use Properties in C++/CLI. You can use thegetandsetto forward to your C++struct(although you should name them differently)