RE: [GD-Windows] GetProcAddress()
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2001-10-16 21:06:23
|
If you use __cdecl and extern "C" declaration for the functions, their name mangling will be C compatible, which is simpler. It is, however, not possible to use function overloading with "C" linkage. A perhaps better way of using DLLs is to have each DLL export one factory function for the kind of services it implements, and return an interface implementing all the services. All function calls into the DLL will then be routed through this one interface. The interface could consist of a simple aggregation of a procedural API, or factory functions for the kinds of classes the DLL exports, or something fancier (such as something you can query for other interfaces by name). In effect, you'd be hand-rolling something COM-like, without the additional management/installation overhead of COM. Another approach, if you don't need the run-time loading, is to just let your app link against the .LIB link library at link time, and reference all the functions directly. This is still a win compared to statically linking everything if you expect some parts of the system to rev much more often than others. Cheers, / h+ > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Erwin de Vries > Sent: Tuesday, October 16, 2001 9:34 AM > To: GDWindows > Subject: [GD-Windows] GetProcAddress() > > > Hi, > > I'm splitting our engine in several parts, and i'd like to use > dll's in some > places using dynamic linking. > > Now i've created a function called MyDLLFunc(). If i want to access this > function in my main app using GetProcAddress() i specify "MyDLLFunc" as > function name, but this fails. After looking into the listing of the dll i > gave it a try to use " ?MyDLLFunc@@YAXXZ " as name. That worked. How on > earth am i supposed to export 20 functions in a decent manner? > Look them up > all up in the listing? I must be doing something wrong. Could > anyone help me > out? > > Thanks, > Erwin > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > |