Quote Originally Posted by wolfulus View Post
int _tmain(int argc, _TCHAR* argv[])
{

// why it displays 10 since I'm using pack() and 3 short vars? why not 6?
printf("sizeof(DefaultPacket) : %d\n", sizeof(DefaultPacket));

// 10 + dword = 14... but i was expecting 10, 4 bytes appeared from nowhere
printf("sizeof(MyAction1) : %d\n", sizeof(MyAction1));
You shouldn't need to know the sizeof() those classes. The classes you are using are non-POD. The size of a non-POD type is useless to you and what you're trying to do.

So trying to figure out what the sizeof() a non-POD type iis indicates you're program is doing something incorrect in terms of design and approach. The one reason to try and figure out the sizeof() a non-POD type is to use placement-new or equivalent, and your program is not doing that.

So you need to go back to the beginning and come up with a different strategy altogether. The sizeof() approach isn't going to work.

Regards,

Paul McKenzie