Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use DLL without reference?

Status
Not open for further replies.

pokermat

Programmer
Jan 17, 2002
44
GB
Hello - I've tried searching for this but the search seems to have died, so...

I have an application which needs to call various DLL's depending on certain conditions.

I don't want to have to re-compile my app everytime one of the DLLs changes (which could be quite often). Is there a way of creating a new instance of a DLL without adding a reference to it at design time?

Any help much appreciated.
 
Yep,

Use the CreateObject Statement

Code:
Dim MyObject As Object

Set MyObject = CreateObject("Project.Class")
 
There could be alternate methods, but you haven't supplied enough info yet. Are you using COM DLLs or standard Windows DLLs? Windows DLLs use DECLARE statements, or can be accessed via Typelibs, COM DLLs either require a reference to them, or can be instantiated using late binding (CreateObject)
nick bulka

 
bjd4jc and Nick...

I am using COM DLLs and as suggested, the CreateObject statement did the job.

Thank you both for your input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top