[GD-Windows] DLL initialization (was: Loading new DLLs on old Windows)
Brought to you by:
vexxed72
From: Andras B. <bn...@ma...> - 2004-02-12 18:14:50
|
My program supports dynamic loading of plugins. Every plugin represents a class, and resides in a separate DLL. Instead of exporting the class itself, I only export a factory function and provide a header file with the declaration of the pure virtual base class (ie. the interface). At runtime, I load the DLL and call the exported factory function, which instances an object and returns a pointer to the base class. This architecture works like a charm on most machines. However, on some configurations, my program reports the following: "Error Code 1114: A dynamic link library (DLL) initialization routine failed." But I have no clue why. Do I have to use DllMain? MSDN says it's only an optional entrypoint.. My DLLs are dynamically linked to the C/CPP run-time libraries. Thanks, Andras |