Reputation: 4777
The following struct is passed from C++ to CLI (To be used by a C# project). It is passing an int and an array of structs:
public value struct CallbackInfo
{
public:
int callbackType;
[MarshalAsAttribute(System::Runtime::InteropServices::UnmanagedType::ByValArray, ArraySubType = System::Runtime::InteropServices::UnmanagedType::LPStruct, SizeConst=1)] array<SystemInfo>^ SystemInfo;
};
How do I modify this so that it only passes a single copy of the struct SystemInfo? And not an array which is of size 1??
Upvotes: 1
Views: 146
Reputation: 613612
Declare it like this:
public value struct CallbackInfo
{
public:
int callbackType;
SystemInfo systemInfo;
};
Upvotes: 1