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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLL file without a Reference 1

Status
Not open for further replies.

Ablecken

Programmer
Jun 5, 2001
130
US
how would you use a dll file without a reference. you could call it a plugin or whatever. I have a dll file that is not needed for everything and if they want it they download the dll file to the same directory. I dont really know how to do it during runtime. any ideas?
 

Check if the dll file exits using Dir() and if it does exist, then use the createobject method - if I understand you correctly.
 
good idea. How exactly would i do that if the path is different then the executable? I guess that is kinda a newbie question so bear with me.
 
Well, you need/should to know the approx. path.

You can use something like FSO (do a search here), or use some API calls, in order to get the Windows, WindowsSystem, Common Files, folders, among others, (could use different drives and different names) and you know how to get the application folder (App.Path) so that is about all you should need to start with.
 
thanx cclint i do know the path

Code:
    Set MyObject = CreateObject(MyDLL.MyClass)
    MyObject.MyMessage ("Howdy")

this gives me variable not defined for MyDLL. I know that i am doing something very simple wrong or that i am missing an important step. Thanx for all the help.
 
i already had the myobject dimmed as an object. what it took was the quotes :). I then had to register the dll. then i got a 429 error active x cannot create object. I actually do tech support for a living and i get this a lot during my day so i added my username to the default com permissions but i still get the error. I'll keep looking but thanx for all your help cclint. i really appreciate it. Any more ideas from you would be appreciated.
 
Does your dll reference other dlls not registered on your target machine?
 
no, actually i have two simple projects. one is the main project and the other is the dll. i want to use the dll if it is there and not care (no errors) if it isnt. I need to send on command or string to the dll. I have it right now sending a string 'howdy' and the dll is trying to grab it and produce a msgbox. i only have one class call MyClass and it has a function ShowMsg(sString as string) and mesgox sString. in the main prog i have it doing
Code:
dim MyObject as Object
set MyObject = CreateObject ("MyDll.MyClass")
MyObject.ShowMsg ("Howdy")
[\code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top