CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    34

    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



  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    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


  3. #3
    Join Date
    Apr 1999
    Location
    Michigan, USA
    Posts
    115

    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.


  4. #4
    Join Date
    Apr 1999
    Posts
    11

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured