Original Post
Hi, I am testing a managed wrapper for native C++ code, so I can access the assembly from C#. The C++ code will be creating the data for my Model in the form of an array of CustomVertex.PositionNormalColored. So in my C# assembly I will create the array and pass to the wrapper, that in turn will populate with data so: C# code: This is the Wrapper Code, (this works, I have a CLI version running): In my native code I have the function so: I cannot get the code to even compile, this is the error: cannot convert parameter 1 from 'cli::array ^' to 'Microsoft::DirectX::Direct3D::CustomVertex::PositionNormalColored *' But I think I have a bigger problem, because at of the day the native code will need to know about the PositionNormalColored data structure, which it can’t because it does not exist in the unmanaged world. Am I right about this? I think that a wrapper will not work, unless I am passing intrinsic types to the native code. My C++ is limited, so any help would be gratefully appreciated Julian
Wrapper wrapper = new Wrapper();
int arraySize = wrapper.GetArraySize();
CustomVertex.PositionNormalColored[] verts = new CustomVertex.PositionNormalColored[arraySize];
wrapper.CreateVertices(verts);
void CreateVertices (array<Microsoft::DirectX::Direct3D::CustomVertex::PositionNormalColored>^ verts);
public: void CreateVertices (Microsoft::DirectX::Direct3D::CustomVertex::PositionNormalColored* verts);