|
-
January 17th, 2000, 01:17 PM
#1
Add reference to DLL in runtime
I have to add reference to a dll in run time as and when required..
How can i do it??
I have tried with Declare/Call method as for other dll files in the system directory of windows.
but for other DLLs ( created by me) it gives error like
"Error during load"!!
Does anyone have any idea if something like plugins be implemented in VB
-
January 18th, 2000, 04:54 AM
#2
Re: Add reference to DLL in runtime
You can create a kind of plugin in VB where you use ActiveX DLL's that export an interface that your program knows about (it might even be the program exporting it). You can then simply get the PROGID of the ActiveX control from somewhere (eg. get myProject.myClass (implements 'myinterface') from an inifile or database), then do a :
'
Dim oObject as myInterface
'
set oObject = CreateObject("myProject.myClass")
'
Call oObject.Initialise (with, some, parameters)
oObject.DoSomething (with, some, other, parameters)
Call oObject.Terminate
'
set oObject = nothing
It is possible to load standard DLL's using LoadLibrary in vb, but you can't call any of the routines contained within them in this way.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
-
January 18th, 2000, 08:03 AM
#3
Re: Add reference to DLL in runtime
>It is possible to load standard DLL's using LoadLibrary in vb, but you can't call any of the routines contained within them in this way.
...unless you use the Call32.DLL that was published a few years ago on VBPJ. This DLL would allow you to dynamically declare DLL functions (including parameters) and call these functions with parameters via an entry point in the DLL.
-
January 18th, 2000, 09:16 AM
#4
Re: Add reference to DLL in runtime
Sounds Good!
Any idea what the issue was ?
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
-
January 18th, 2000, 09:37 AM
#5
Re: Add reference to DLL in runtime
>Any idea what the issue was ?
unfortunately not.
But, I found the call32.dll in our network and I remember having tested it.
OTOH, I might even be wrong and the DLL is only for 16 bit apps calling 32 bit DLLs?
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
|