Hello,

I have encountered a serious problem in my mode and was hoping someone may have a suggestion.

I have a 3rd party library (cringe) and I have used it successfully in many projects. For the last 2 weeks I have been looking for a mysterious crash and I found the cause now.

I have a MDI application and the control is initialized in a form, derived from CFormView for a child window. Everything works great. In fact, anywhere in the whole application I call sizeof(theclass) I get the proper size.

Except my DOC class for the project. Whenever I access a couple of public variables from the DOC I get crashes. Turns out if I get the size of the class, it is 48 bytes less than anywhere else in the application. This causes all my data members to be completely wrong and in the wrong locations.

I have looked at the assembly code and sure enough only in the DOC class is the wrong offsets being added to the member variable references which I expected.

I have tried forcing padding and alignment but no luck. I have the sources for the 3rd party library but nothing in there forces padding or alignment. And as I say I use this library successfully in many places and I always use it the same way.

Does anyone have even a slight hint where I should start looking for this problem?

Thanks.