Solved

Incompatible exports - when?

Posted on 1998-07-27
2
164 Views
Last Modified: 2010-04-02
Can anyone give me all the rules for determining when objects exported in a DLL (classes, functions) are to lose their compatibility with a previous version (e.g. adding a function to a class)?
0
Comment
Question by:gil_mo
2 Comments
 
LVL 11

Accepted Solution

by:
alexo earned 40 total points
ID: 1168737
Whenever a VIRTUAL member function is added or deleted, the layout of the vtable changes, resulting in wrong member functions being called by the virtual dispatch mechanism.

Whenever any member is added/removed the size of the objects changes, resulting in new/delete operating on wrong memory sizes, leading to protection violations.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1168738
>> Whenever any member is added/removed the size of the objects
>> changes, resulting in new/delete operating on wrong memory sizes,
>> leading to protection violations.
Actually, you should recompile if you make and changes to the data members.  For example, if you swap the order of two data members.  This is because,  you might have code that dirrectly acceses the members (if they are public or if there is inline class code that does so)

Also note that if any of these changes are made to a base, class, then the derived classes must also be considered changed.

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question