I love Borland's (or should I say CodeGear's) C++Builder. I've always found it a very handy tool for creating quick apps with a GUI. I've never been a GUI programmer, and I'm not an enthusiast for spending tens of hours getting the user interface right, so I've always appreciated how easy Borland make this part. However, the C++ compiler is not 100% "Microsoft compatible" and this has sometimes caused problems with our SDK.

A problem that has tripped me up a number of times is that of alignment of structures. The Borland compiler has a myriad of options when it comes to optimizing the memory usage of structures. For example, it allows you to set that variables inside a structure can be aligned by qword, dword or word, which presumably allows fewer memory fetches with some processors, and so a speed optimization. Also, you can save space in memory by packing a bool into one byte instead of two.

The problem comes when you then call an external DLL (such as the Diva Server SDK, DSSDK.DLL) and pass in one of these optimized structures. Of course the receiving SDK sees the data all 'off by one byte', or reads padding bytes as valid data, and so mysterious failures result. Bitter experience has taught me the correct compiler settings to make C++Builder work with the SDK, but of course the same problems are there potentially for any sexy new tool that people might use in preference to the 800 pound gorilla, Microsoft Visual C++.