C++ Changing a class in a dll where a pointer to that class is returned to other dlls...
- by Patrick
Hello,
Horrible title I know, horrible question too. I'm working with a bit of software where a dll returns a ptr to an internal class. Other dlls (calling dlls) then use this pointer to call methods of that class directly:
//dll 1
internalclass m_class;
internalclass* getInternalObject() {
return &m_class;
}
//dll 2
internalclass* classptr = getInternalObject();
classptr->method();
This smells pretty bad to me but it's what I've got... I want to add a new method to internalclass as one of the calling dlls needs additional functionality. I'm certain that all dlls that access this class will need to be rebuilt after the new method is included but I can't work out the logic of why.
My thinking is it's something to do with the already compiled calling dll having the physical address of each function within internalclass in the other dll but I don't really understand it; is anyone here able to provide a concise explanation of how the dlls (new internal class dll, rebuilt calling dll and calling dll built with previous version of the internal class dll) would fit together?
Thanks,
Patrick