Results 1 to 9 of 9

Thread: Create DLL and using it

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    145

    Create DLL and using it

    Hi,
    Application that i develop is getting big, so i planned to divide it into small piece of DLL.

    My question is how to create DLL and then using it in my application and what is best to put in DLL (only function and no instruction to change screen -- view a FORM, TEXTBOX, Etc -- or what?) ?

    Thanks

  2. #2
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Create DLL and using it

    You can't make standard Windows DLL from VB6. (atleast not easily)

    Here is a tutorial on Create an ActiveX dll. It may help you.

    You can put anything you want in the dll. I would recommend to putt the functions you don't frequently need. When you need the function, create an instance of the objet that you need from that dll and when you are done with it, destroy the object. This will save memory.
    VB Code:
    1. Dim myObj As MyDll.Object1
    2. Set myObj = New MyDll.Object1
    3. ' ... ... ... ...
    4. Call myObj.SomeMethod()
    5. ' ... ... ... ...
    6. Set myObj = Nothing
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    145

    Re: Create DLL and using it

    What is your recommendation for me (to split my application into small piece)?

  4. #4
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Create DLL and using it

    Unfortunetly no one other than you can decide what to put in those dlls.

    If the compiled exe is within ~2MB range and the application doesn't take more than ~32MB RAM, then I think it will be no problem for modern systems.

    As I mentioned in my previous post, you can move some functions to a dll to free up some memory. But instantiating and calling a function from another object is a little slower - but unless you need it realtime it will not cause any problem.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    145

    Re: Create DLL and using it

    Thanks iPrank, you made thing bit clear for me now.

    BTW, i made Application with MDI FORM and Child (of course ), i haven't made limitation how many same or another form can be open. Before decide to do that i have test create MDI application and test open more than 50 from with few control on it, application still ok (no crash). But in real application (my application) it open 15 form (with relatively a lot of control on it) it will crash, suffer for out of memory.

    Can you inform what is VB limitation for memory thing and such as?


    PS: kind of spooky avatar you have

  6. #6
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Create DLL and using it

    I don't know VB's limitation. But I've never faced out of memory problem when working with multiple forms.

    First look for unneeded recursions. In most cases some kind of recursive event procedures causes out of stack space.
    Look for any unneeded objects that you haven't destoyed.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    145

    Re: Create DLL and using it

    Hmm.. i did have one recursion. Will check that.

    Sorry to take advantage of you, but seems you know a lot about vb and api (your signature). If you have some time please take a look at my unresolved post here :

    http://www.vbforums.com/showthread.p...ight=mousedown

    Thanks

  8. #8
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Create DLL and using it

    LOL. I don't know much. Thanks to Ctrl+C Ctrl+V.

    I'll go to an overnight party in a few minutes. I'll look into your other problem when I return tomorrow.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    145

    Re: Create DLL and using it

    Enjoy your Party, drink till you drop. Don't forget to wake up tomorow

    Thanks iPrank

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