|
-
Sep 23rd, 2003, 01:53 PM
#1
Thread Starter
Member
Dymanic load DLL
HI all,
I created an apllication and a dll.
Can somebody provide me a simple piece of code, how to load the dll and load a form created in the dll and how to unload the dll after closing the form inside the dll.
Thanks,
AXH
-
Sep 25th, 2003, 02:52 PM
#2
Thread Starter
Member
Can somebody help me with this ??
-
Sep 25th, 2003, 02:59 PM
#3
Sleep mode
Well , I don't know what is this form you want to load from the dll . Is this dealing with plugins archit. ?
-
Sep 25th, 2003, 03:07 PM
#4
Thread Starter
Member
Just a normal windows form
-
Sep 25th, 2003, 03:10 PM
#5
Sleep mode
In what lang did you write that dll ?
-
Sep 25th, 2003, 03:17 PM
#6
Thread Starter
Member
-
Sep 25th, 2003, 03:24 PM
#7
Sleep mode
OK , the general idea of loading a dll is as follow :
First , reference your dll by right clicking on the Reference item in the project explorer . Browse to your dll . Click Select and then OK .
Secondly , import your dll in your form or whatever by typing first the namespace something like this :
VB Code:
Imports MYAPPLICATION.MyClassForm
Thirdly , Instantiate an obj and use the methods inside it as you do with anyother obj in .NET .
VB Code:
Dim MyCls As New MyClassForm
MyCls.Your methods here
I still don't know if this would help you in anyway .
-
Sep 25th, 2003, 03:41 PM
#8
Thread Starter
Member
Thanks, it's working
By the way,
I will split up my program by using dll's.
Is there a program or a something else to check if the dll is available so I can catch the fault message and write a program to download the specific download.
Thanks again
AXH
-
Sep 25th, 2003, 03:50 PM
#9
Sleep mode
Umm , what do you mean by splitting up your app into dlls ?
-
Sep 25th, 2003, 03:55 PM
#10
Thread Starter
Member
I will split up my program up in for example query / export /import / maintenance
So I thought I will make four seperate dll's
Not a good idea ? or do you have a other option
AXH
-
Sep 25th, 2003, 04:18 PM
#11
Sleep mode
For me , I wouldn't bother making 4 dlls . You have either these options :
1-Pack your Classes & Functions into one dll .
Or
2-Put them in separate modules , let's say 4 modules if that's possible in your case .
Advantage of the second option :
1-Faster when making updating , corrections , addition , deletion ...etc to the source code .
2-Much more eaiser when deploying your app . No need to look for the dlls , no possiblity of losing your dlls (i.e can't delete these dlls )
-
Sep 25th, 2003, 04:25 PM
#12
Thread Starter
Member
Why is there no need for looking for dll's
Before I start the program and I will move the dll or rename the dll I will get an exception error!
-
Sep 26th, 2003, 10:37 AM
#13
Sleep mode
Originally posted by ahollaar
Why is there no need for looking for dll's
Before I start the program and I will move the dll or rename the dll I will get an exception error!
Because the file name has been changed either by its name or the location and is no longer accessible from your proj . In this case if you did any of the above operation you have to re-reference the file .
-
Sep 26th, 2003, 10:53 AM
#14
Thread Starter
Member
And for example a stupid user delete / moved the dll what todo then. The progrma will generate an error
-
Sep 26th, 2003, 11:16 AM
#15
Sleep mode
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
|