-
CreateObject ???? HELP!!
I have a DLL that I want accessible using CreateObject("Class...."). I can get the DLL to work if I set a reference in VB and it works fine, however, I need the DLL accessible with VBScript as well. Does anyone know of a tutorial or a quick and easy way to set up a DLL that can be utilized with the CreateObject function? I need it to look something like this
set MyObj = CreateObject("MyDLL...")
MyObj.Property1 = "Hello"
MyObj.Property2 = "World!"
MsgBox MyObj.Property1 & " " & MyObj.Property2
Set MyObj = Nothing
-
Just go to VB5 or 6, create a new DLL project, and mess with the class, add the functions etc you need. Compile it and put it where it needs to be.
Go to your VBScript and type
Set obj = CreateObject("ProjectName.ClassName")
So if your project name is "Joe" and the Class name is "Fred" then you type
Set obj = CreateObject("Joe.Fred")
You're ready to roll!