0
votes

I have a 64 C++ COM server and a C# COM client. Now I want to pass a structure from the server to the client that holds a 64 bit integer.

I use the keyword "hyper" for the MIDL compiler and can see that the field is _int64 in C++ and long in C#.

But if I set the value 0x0000000000000001 in C++ I get 0x0000000100000000 in C#.

How can I correct this problem?

1

1 Answers

0
votes

It was actually a question of alignment. My 64 bit number was not aligned in the structure. Added a #pragma pack(4) before the structure definition. Then it worked.