-
DLL and DEF-File
Hi !
I made successfully a dll, which runs very well. The problem: The DLL is very large and I heard of something with a DEF-File and "export by ordinal", which "shrinks" the names and the loading-time. But I have NO idea, how to use it. Any manuels or examples would be very, very helpfull. Thanks a lot !
Regards
Martin
-
Re: DLL and DEF-File
There is a wealth of information within the VC++
help system, MSDN, the web, and elementary level
Windows (not MFC) programming books that
describes what a DEF file is and how to use it
when building a DLL.
In short, a DEF file is just a text file that
describes the DLL and the functions that are
exported (and imported with the old 16-bit
DLL's). The EXPORTS section allows you to list
the exported functions with an ordinal number
associated with each function.
Regards,
Paul McKenzie
-
Re: DLL and DEF-File
A word of caution pertaining to exporting by ordinal:
As time goes on, the need to modify the dll will increase. You should never rearrange the ordinal numbers of you functions. You should only add new functions to the end of the list. You should never remove an existing function. There are more you should nevers that MSDN covers.
Example:
1 MyFunc1()
2 MyFunc2()
3 MyFunc3()
If you rearrange the functions in the export older programs will call these functions expecting them in the above order. If they invoke MyFunc2 and are expecting MyFunc1 you will notice some very strange behavior (what that behavior would be depends on what MyFunc1 and MyFunc2 do, what parameters they expect, what the will return, etc.).
Inserting new functions or deleting functions will give similar results.
-
Vc++
First of all tell me on what u r working if u r working on vc++ then I can give u the solutions which might satisfy u to some extent.
Def file usually contains the exported functions of the dll , and this in turn will create the lib which usually contains the ordinals, function address. Using this might be helpful bcoz u have the fn address available which will be invoked dynamically, but the time taken by this also is relatively slow.
Thnks
Savitha