Thread: laoding dll files

  1. #1
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110

    laoding dll files

    I read another thread about how dlls files are used for massive programs and keep common functions in them, I would like to know how to:

    get an exe to read from a dll
    have normal text mode in the dll, like if I open it in note-pad I can easily read the code (not cyphered)

  2. #2
    Registered User slaveofthenet's Avatar
    Join Date
    Apr 2003
    Posts
    80
    DLL's contain compiled code, you can't open them up and view the actual source.
    Detailed understanding of language features - even of all features of a language - cannot compensate for lack of an overall view of the language and the fundamental techniques for using it. - Bjarne Stroustrup

  3. #3
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110
    then how would I read them (from exe), and how would I compile them?

  4. #4
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    DLL = Dynamically Linked Library.

    Therefore, they are linked dynamically That means, they aren't linked at compile-time, but are accessed at run-time, and thus they need to be present on the computer that your exe is running on, at the time that your program is running.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  5. #5
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110
    I meant the code to make 'em

  6. #6
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    then how would I read them (from exe)
    Sorry, your question's phrasing kinda took me outta the loop there... The answer is, I don't know I've never done it or tried, I just know that that's how they're supposed to work.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  7. #7
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    You can't "read them", but your exe file can "use them". DLLs seem to be mostly used in Windows programs, although I seriously doubt that dymanic linking is exclusive to Windows. Maybe the .dll extension is a Microsoft "thing".

    The Windows API uses DLLs. For example, some DLL has the CreateWindow() function in it, so your compiled code doesn't need to have all of the machine code required to create a window, and this code doesn't have to be duplicated in every Windows program. In general, when you write a Windows program, you don't know which DLLs you are using... you just include Windows.h, and you can use all the WinAPI functions without worrying about DLLs.
    At least this is how I understand it... I'm sure someone will correct me if I'm wrong.

    You have to include the appropriate header file, if you want your program to use some DLL.
    You can write and compile your own DLL by setting-up your compiler options.

    I don't know the exact details... I'd have to review my Petzold book...

    [EDIT]
    Example 1 - Say you are writing an Office Suite with a word processor and a spreadsheet. You could put some of your common functions/functionality in a DLL... Maybe you have some code to decode and insert a jpeg picture. You might want to do that with a DLL, so that you don't duplicate the code in both programs.

    Example 2 - We have USB and PCI versions of a product. There are also 2 different versions of a DLL (that talks to the driver). The customers write their own EXE's... and their EXE will work with either type of hardware as long as the correct DLL is installed. I think this is unusual, because usually only the drivers are different.
    Last edited by DougDbug; 08-07-2003 at 05:21 PM.

  8. #8
    Registered User
    Join Date
    May 2002
    Posts
    66
    Windows has DLL, *nix uses SO files. You use calls similar to LoadLibrary in your code.

    Both can be accessed by using things called ordinals or in case of C actual function names.

    Read more about DLLs here:
    http://home.hiwaay.net/~georgech/Whi...orting/Exp.htm


    DLL code to which you do not have an export library is not really meant to be screwed around with unless you want to make calls based on ordinals. If you don't know what those are, read up about what a DLL is, how to build one and what their internal structure is. Often ordinals will assume you understand name mangling.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to Free a Load-Time DLL?
    By Ktulu in forum Windows Programming
    Replies: 7
    Last Post: 11-16-2006, 05:43 PM
  2. Replies: 1
    Last Post: 09-18-2005, 09:06 PM
  3. OpenCV Library - problems with dll files
    By nipun in forum Windows Programming
    Replies: 3
    Last Post: 11-21-2004, 10:36 AM
  4. Working with DLL files...
    By Devil Panther in forum Windows Programming
    Replies: 8
    Last Post: 11-15-2004, 12:42 AM
  5. reinserting htm files into chm help files
    By verb in forum Windows Programming
    Replies: 0
    Last Post: 02-15-2002, 09:35 AM