Re: [GD-General] Sharing DSP between static lib / DLL
Brought to you by:
vexxed72
|
From: Pierre T. <p.t...@wa...> - 2003-01-14 14:38:49
|
> Oh fine! I just thought that the export/import information was not
preserved
> in the lib file, and I had never tested that without a def file. It's nice
> to know that it just works.
Now that I think about it, I might be confused a bit. Here's the thing :
1) In a standard DLL, if I want to export a function I write something like
:
__declspec(dllexport) int SomeFunction(int some_param);
Then SomeFunction() can be found in the DLL, with a decorated name. Any
application that wants to use it has to include the header, link with the
.lib, and the .dll is used at runtime. You can't use GetProcAddress on
SomeFunction(), unless you use a .def file.
2) In a standard DLL, if I write this instead :
extern "C" __declspec(dllexport) int SomeFunction(int some_param);
Then we have the same story, except you can now use GetProcAddress on
SomeFunction() without a .def file, i.e. the name is not decorated. This is
handy in MAX file to get rid of the .def file, for example.
3) Now, in a static library, I don't have any import / export marks. I just
have :
int SomeFunction(int some_param);
If a DLL wraps that library, SomeFunction() doesn't appear in the DLL (with
a decorated name or not), so you can't use GetProcAddess() on it, but you
can still use it in your app (the app beeing otherwise using the wrapping
DLL).
What are .def files useful for, exactly, when not using GetProcAddress() ?
Pierre
|