Explicit DLL call...
-
Hi, Is it possible to call explicitly a class from a DLL (not a simple C function but a C++ class)? I suppose we must use
::Loadlibrary("my_dll_path_to_call")
andGetProcAddress(hInstance, "class_name_from_dll")
... like the call of a simple C function! Thanks for your suggestion. Hello World!!! :) from Raphaël -
Hi, Is it possible to call explicitly a class from a DLL (not a simple C function but a C++ class)? I suppose we must use
::Loadlibrary("my_dll_path_to_call")
andGetProcAddress(hInstance, "class_name_from_dll")
... like the call of a simple C function! Thanks for your suggestion. Hello World!!! :) from RaphaëlEven if this was possible, what would you do with the result of
GetProcAddress(hInstance, "class_name_from_dll")
? Think it over, a class is not an entity per se in a program, only their instance objects (The situation differs in Java and C#, where classes are program entities).GetProcAddress
will give you pointers to functions, with a little work it is possible to make it return pointers to the methods of a given class: if this is what's in your mind, you might consider exporting classes from a DLL (see the docs), but this is a whole different beast than you're asking for. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
Even if this was possible, what would you do with the result of
GetProcAddress(hInstance, "class_name_from_dll")
? Think it over, a class is not an entity per se in a program, only their instance objects (The situation differs in Java and C#, where classes are program entities).GetProcAddress
will give you pointers to functions, with a little work it is possible to make it return pointers to the methods of a given class: if this is what's in your mind, you might consider exporting classes from a DLL (see the docs), but this is a whole different beast than you're asking for. Joaquín M López Muñoz Telefónica, Investigación y DesarrolloYeap... It's true... I had forgotten this... Thanks. (I think that I will sleep early today :zzz: ) Hello World!!! :) from Raphaël