can anyone provide me a link to pass structure for C++/CLI .
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Shweta LodhaRank #31 · 39.8K reputationPosted Mar 1, 2014, 2:25 AM EST
http://stackoverflow.com/questions/5375370/wrapper-for-dotnet-to-native-written-in-c-cli-bestway-to-pass-strutures?rq=1
Ehtesham MehmoodRank #719 · 3.3K reputationPosted Mar 1, 2014, 4:47 AM EST
http://stackoverflow.com/questions/19400349/how-to-pass-structure-to-function-in-c
Graeme Pariot148 reputationPosted Mar 16, 2014, 12:35 PM EDT
Thanks for your answer, but I am looking for C++/CLI and not for C++.
VulpesRank #55 · 29.2K reputationPosted Mar 16, 2014, 12:57 PM EDT
Graeme Pariot148 reputationPosted Mar 16, 2014, 1:08 PM EDT
I want to pass sctructure from C# to C++ layer and code is something similar to this:
\\C++
typedef struct
{
INFO16 A;
INFO8 B;
INFO8 C;
INFO8 D;
INFO8 E;
}
DATA;
\\C++/CLI
[StructLayout(LayoutKind::Explicit)]
public value struct DATA
{
public:
[FieldOffset(0)]
UInt16 A;
[FieldOffset(2)]
Byte B;
[FieldOffset(3)]
Byte C;
[FieldOffset(4)]
Byte D;
[FieldOffset(5)]
Byte E;
};
VulpesRank #55 · 29.2K reputationPosted Mar 16, 2014, 1:17 PM EDT