Click here to Skip to main content
15,918,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a native C/C++ struct
typedef struct 
{ 
... 
} AStruct; 

and in C++/CLI code i define one delegate and one cli array as following
public delegate void UpdateDataDelegate(AStruct% aSt,AStruct% bSt); 
 
cli::Array<AStruct>^ args=gcnew cli::Array<AStruct>(2); // 
complile failed!!!!。

this->Invoke(updateData,args); 

AStruct has many fields and was used by many modules so if i don't like to write a mananged wrap for AStruct, how to make above code works?
many thanks
Posted

1 solution

Is it giving error as


error C2691: 'MyStruct' : a managed array cannot have this element type


//Mystruct is defined in my project

...

Also I think such kind of function might be possible using pinning pointers

USE PINNING POINTERS
CHECK INTERIOR POINTERS also

reply ....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900