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

Newbie need help to call function in ActiveX.dll

Status
Not open for further replies.

gudfadern

Technical User
Feb 18, 2002
2
SE
Hi

I need to call an ActiveX.dll from whitin VBScript.
I'm a newbie to VisualBasic 6.0. I have created and tested my Dll. Now I have to "trigger" it from whitin a program only supporting VBScript. I'ts not exactly the same syntax and stuff. The code (VB6)I used to test my DLL is below!

Private Sub cmdExekvera_Click()
'koppla mot DLL
Dim strApplikation As String
Dim blnSuccess As Boolean
Dim oRun As prjEdis.cEdis

strApplikation = "notepad"

Set oRun = New prjEdis.cEdis

MsgBox oRun.RunApp(strApplikation)
End Sub

This is only a simple example for me to understand. I need to call my DLL from VBScript. Pass arguments to it and finaly receive a result. If it's been a success or not. The above example will only start "notepad". I know I can start a program from VBSript but my point is that I have to call my DLL. The DLL I will finally use is intended to put a new record in a DB. The DLL is registered with my system using regsvr32.

Could anyone please help me to convert the above VB code to VBScript.

Yours sincerely Gudfadern
Ps this is the first time I start a thread, hope I do it correctly
 
Hi Culshaja

Thankyou for your reply, though it wasn't complete. But it led me in the right direction. All I needed to do is figure out the bottom Line.

The solution looks like:

dim x
dim Y

set x = CreateObject("prjTest.cTest")
y = x.RunApp (Argument1,Argument2,ETC...)

remember to take care of the answer in variable Y

For all you looking to use something similar, the dll I am
accessing is created in VB(6) as an ActiveX Dll, The
project is named 'prjTest' and the class 'cTest'...

Thankyou for guiding me in the right direction
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top