|
|
|
|
To minimize the possibility of data corruption when exporting a class with __declspec(dllexport), ensure that: * All your static data is access through functions that are exported from the DLL. * No inlined methods of your class can modify static data. * No inlined methods of your class use CRT functions or other library functions use static data (see Potential Errors Passing CRT Objects Across DLL Boundaries for more information). * No methods of your class (regardless of inlining) can use types where the instantiation in the EXE and DLL have static data differences. You can avoid exporting classes by defining a DLL that defines a class with virtual functions, and functions you can call to instantiate and delete objects of the type. You can then just call virtual functions on the type. For more information on exporting templates, see http://support.microsoft.com/default.aspx?scid=KB;EN-US;168958. C4251 can be ignored in Microsoft Visual C++ 2005 if you are deriving from a type in the Standard C++ Library, compiling a debug release (/MTd) and where the compiler error message refers to _Container_base. |
|
|