Tech Support > Microsoft Windows > Development Resources > dll returning reference
dll returning reference
Posted by todma on November 14th, 2007


is it safe for a .DLL to return a reference (to a vector<>) to the
main application if the main application uses it to access data from
the DLL immediately?
Todd.

Posted by Scott McPhillips [MVP] on November 14th, 2007


"todma" <toddmarshall2002@yahoo.com> wrote in message
news:1195051616.642432.118490@o3g2000hsb.googlegro ups.com...
Yes.

However, if the main application attempts to modify the vector in a way that
causes reallocation, it is only safe if both the app and DLL use the same
DLL runtime library. If they use different libraries then modifications
will fail.

--
Scott McPhillips [VC++ MVP]



Similar Posts