In C++ on Win32:
Suppose I have a DLL with a header file that declares a class. The DLL exports some means of obtaining a pointer/reference to an instance of that class, such as a factory function.
Am I correct in believing that it is not necessary to mark that class as exported using __declspec if one is only going to call virtual or inline functions on its instances?
Conversely, is it necessary to export the class declaration if one wishes to call nonvirtual member functions?
Am I correct in believing that it is not necessary to mark that class as exported using __declspec if one is only going to call virtual or inline functions on its instances?
Yes,this is correct, and that's what COM do, the DLL only expotys 4 methods, one of them returns to the class factory, which all its members are pure virtual functions.
Conversely, is it necessary to export the class declaration if one wishes to call statically defined member functions?
No, just export the static member functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With