Results 1 to 14 of 14

Thread: Excuse my ignorance...

  1. #1

    Thread Starter
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    Err, I know this is a really simple question, and you'll all laugh and point at me, but what's a DLL and what use is it? I know you need certain DLLs to run certain apps, and that DLL stands for 'dynamic link library' or something, and I've inferred from what people have said that you can make them using VB/C++ but I really don't know what one is.

    Same goes for ActiveX controls actually.

    I've used VB now and then for about 2 years, but I was at college (that's A-Levels to all you Americans out there) so I was too busy wasting my time to be concentrating on programming

    Can anybody help me out?

  2. #2
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    If you'll notice when you declare API's that there's often a dll reference (or just "kernal32" and "user32" which are DLL's in your system folder). Same thing. You can reference individual functions from VB in the same manor. You can compile ActiveX DLLs in VB, but most often, DLL's are written in Visual C++ from what I've been able to learn.

  3. #3

    Thread Starter
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    I've never used APIs, so I haven't noticed, but I'll be sure and notice it when I do

    Thanks a lot for the explanations Micah.

  4. #4
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444

    Post

    here is another question about this topic.
    I customize autocad with VB instead of VBA.
    most people recommend that I make DLL files instead of EXE files because my program will "interact" with autocad faster as a DLL
    I don't understand why a DLL will interact with autocad faster. Can someone explain this?
    Also, I thought that a DLL could have a form

    ------------------
    I am so skeptacle, I can hardly believe it!

  5. #5
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    Yes a DLL can have a form ... or message boxes or whatever. I'm no expert keep in mind. I'm assuming the a dll would be faster because it's reading the functions as it needs it where as an exe probably hass to execute tons of it's own functions before even interacting ... that is the program has to load and create all it's classes and objects.

    But I'm just guessing here

  6. #6
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    Not an ignorant question at all. I'm no expert or anything but can tell you this. DLL's contain functions that can be called from your, or any other program so that certain functions that are commonly used don't have to programmed in ever program but each program can call to that one instance of it. Also, if a more efficient function is written, simply replacing the dll with a new one can be done, providing it's not changed to the extent that names and return values are changed.

    ActiveX (OCX) controls are the same idea, only they include a graphical interface. They can be created in VB using normal VB code. This way if you have a bunch of controls that behaive in a particular manner together that you use often, creating an OCX for them could be one solution. Say for example you make your own progress bars by putting a label in a picture box and making it "Grow". You could create your own activeX control by placing those same controls and code in the OCX and the compiling and registering it with windows. Then when you open the components dialog, your control would be there.

    If perhaps you're interested in creating your own controls, there's a brief intoduction tutorial on this site in the "Active X" section under "Topic Areas"

    ------------------
    Micah Carrick
    http://micah.carrick.com
    [email protected]
    ICQ: 53480225


  7. #7

    Thread Starter
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    DLLs sound a bit like modules. Is that right? Are they similar?

    So ActiveX controls are like mini-projects then? You can make a set of controls (the picture box and label in your example) and add code to them to make them behave in a certain way, andthen compile them into an ActiveX control. Then, later on, when you want to use that same mini-project in a normal project, you can just sort of import it by using it as a control. Just like you might place a text box on a form. Am I close?

  8. #8
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    Yes, that's just about it. DLL's are what make visual basic possible. That's why your EXE is so small, because all the functions and routines for common tasks are stored in DLL's that many many programs share, Runtimes etc.

    A mini project is a perfect way to think of an activeX control. A little mini project that is customizable in some ways and can be used over and over by you and anyone else who wants to use it, provided you give it to them.


  9. #9
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    DLL's should NEVER (well, almost never) have a user interface. DLL's are libraries of methods and sometimes resources, but the user interface/interaction should be left up to the UI developer. DLLs perform the logic and return a value to the calling app, and the calling app decides what to do with the return value.

    DLLs are a way to reuse code, partition an application into separate logical layers, and provide incremental improvements to the dependant applications without having to recompile your client EXEs. They also allow for higher level development (VB!) because we can call a function in a library and have the library perform the task for us (example: API's) so we don't have to try to reinvent the wheel every time we write a new app.

  10. #10

    Thread Starter
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    Thanks, that's cleared it up a lot.

    How would you go about making a DLL then? I've called functions that I've made from modules before, is a DLL just the same kind of thing as a module? Do you need APIs and things like that? (APIs are another thing I'm not sure about - I'll be reading up on them some time soon.)

  11. #11
    Member
    Join Date
    Jan 2000
    Location
    Glasgow, MT, USA
    Posts
    44

    Post

    DLL Stands for Dynamic Link Library

    I think!

  12. #12
    Junior Member
    Join Date
    Jan 2000
    Posts
    21

    Post

    This text was taken from Programming MS Visual C++, 5th edition:

    "Basically, a DLL is a file on disk (usually with a DLL extension) consisting of global data, compiled functions, and resources, that becomes part of your process. It is compiled to load at a preferred base address, and if there's no conflict with other DLLs, the file gets mapped to the same virtual address in your process. The DLL has various exported functions, and the client program (the program that loaded the DLL in the first place) imports those functions. Windows matches up the imports and exports when it loads the DLL."

  13. #13

    Thread Starter
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    That's what I thought. *Points to Phil's message* Why dynamic? I get the idea that they're libraries of functions. Not sure what makes them dynamic though.

    [This message has been edited by HarryW (edited 01-20-2000).]

  14. #14
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Dynamic means that they are loaded at runtime when a function within the library is needed, and unloaded when not needed.

    If it were not dynamically loading/unloading, your app would load every DLL into memory at startup that it may have only needed once, wasting memory resources, and would not unload them until the app is terminated.

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