Hello B.C.,
This might be a stupid question but the answer evades me at this moment. You
know how in C/C++ compiler settings influence the size of
structures/classes. How come the windows api (which often takes pointers to
structures as parameters) still works independently of my compiler settings?
Thanks
The pointers are a certain, agreed upon size. The structures that they
point
to could have problems with your code if your code did not obey the packing
options expected by the Windows API. There are several ways to control
packing
in C and C++. One is by the compiler settings and that controls the packing
options for the entrire compile session. Another method is to use the
"#pragma pack" option. This can be used to set a desired packing option and
later restore the packing option to the default level. Good communications
code that depends on the packing options of a structure will include these
packing options around the critical structures in its headers. If you look
at the headers that define such critical Windows API Structures, you will
find where they have enclosed those structures with the desired packing
options. This is no different than how any other API could achieve the
same goal.
I hope that jogs your memory for you.
David