W
wanderer
I've imported a function from a DLL that takes a custom
structure. Something like:
typedef struct _myStruct{
INT16 A;
UINT32 B;
} myStruct;
Now, I want to use the function in C#, but I don't have a
definition of the structure. Thus, I defined the
equivalent structure in my C# code. Now here's the
problem:
I know in C# I can force my managed code to lay out the
variables sequentially ( [ StructLayout(
LayoutKind.Sequential )] ), but how do I force my C++
side to do so too if I am using eVC++ 4.0 ?
It doesn't seem to recognize the '#using' command, so I
can't use:
#using <mscorlib.dll>
#using <System.dll>
using namespace System;
using namespace System::Reflection;
using namespace System::ComponentModel;
using namespace System::Runtime::InteropServices;
[StructLayoutAttribute(LayoutKind::Sequential)]
Thanks.
structure. Something like:
typedef struct _myStruct{
INT16 A;
UINT32 B;
} myStruct;
Now, I want to use the function in C#, but I don't have a
definition of the structure. Thus, I defined the
equivalent structure in my C# code. Now here's the
problem:
I know in C# I can force my managed code to lay out the
variables sequentially ( [ StructLayout(
LayoutKind.Sequential )] ), but how do I force my C++
side to do so too if I am using eVC++ 4.0 ?
It doesn't seem to recognize the '#using' command, so I
can't use:
#using <mscorlib.dll>
#using <System.dll>
using namespace System;
using namespace System::Reflection;
using namespace System::ComponentModel;
using namespace System::Runtime::InteropServices;
[StructLayoutAttribute(LayoutKind::Sequential)]
Thanks.