|
-
Feb 10th, 2007, 12:54 AM
#1
Thread Starter
Addicted Member
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
-
Feb 10th, 2007, 01:06 AM
#2
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:
Dim myObj As MyDll.Object1
Set myObj = New MyDll.Object1
' ... ... ... ...
Call myObj.SomeMethod()
' ... ... ... ...
Set myObj = Nothing
-
Feb 10th, 2007, 01:14 AM
#3
Thread Starter
Addicted Member
Re: Create DLL and using it
What is your recommendation for me (to split my application into small piece)?
-
Feb 10th, 2007, 01:22 AM
#4
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.
-
Feb 10th, 2007, 01:45 AM
#5
Thread Starter
Addicted Member
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
-
Feb 10th, 2007, 01:57 AM
#6
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.
-
Feb 10th, 2007, 02:27 AM
#7
Thread Starter
Addicted Member
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
-
Feb 10th, 2007, 02:32 AM
#8
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.
-
Feb 10th, 2007, 03:24 AM
#9
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|