Solved

Incompatible exports - when?

Posted on 1998-07-27
2
163 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
Comment Utility
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
Comment Utility
>> 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now