I've got what I think is an unusual question. I have a very messy situation with multiple languages and trying to pass info from one to the other. Here's the short version.
I use VBScript to call a function in a VB6 .dll file. The VB6 .dll calls an old Delphi .dll and the Delphi .dll spits out a value. Here's how the code breaks down to do all of this.
VBScript snip:
VB6 HTS2Interface.dll snip from the CLASS MODULE:
VB6 HTS2Interface.dll snip from the MODULE:
The message box from the MODULE portion of the .dll returns a TRUE value for bolShowLoadBuildDlg. I need to get that TRUE value passed back to the Result in the VBScript script.
I'm sure there is a cleaner, easier, 'more correct' way to do this, but I'm kind of stuck doing things this way. Any pointers for a non-scripter trying to write script?
Thanks in advance for the help!
Joe
I use VBScript to call a function in a VB6 .dll file. The VB6 .dll calls an old Delphi .dll and the Delphi .dll spits out a value. Here's how the code breaks down to do all of this.
VBScript snip:
Code:
Set objDLL2 = CreateObject("HTS2Interface.HTS2Objects")
Result = objDLL2.vbsShowLoadBuildDlg(TH, Weight, TableNo, 1)
MsgBox Result
VB6 HTS2Interface.dll snip from the CLASS MODULE:
Code:
Public Function vbsShowLoadBuildDlg(ByVal lngTH As Long, ByVal Weight As Long, ByVal TableNo As Long, ByRef LoadNo As Long) as Boolean
On Error Resume Next
modHTS2.Call_ShowLoadBuildDlg lngTH, Weight, TableNo, LoadNo
End Sub
VB6 HTS2Interface.dll snip from the MODULE:
Code:
Public Declare Function ShowLoadBuildDlg Lib "C:\windows\system32\HTS2.DLL" Alias "#152" (ByVal lngTH As Long, ByVal Weight As Long, ByVal TableNo As Long, ByRef LoadNo As Long) As Boolean
Public Function Call_ShowLoadBuildDlg(ByVal lngTH As Long, ByVal Weight As Long, ByVal TableNo As Long, ByRef LoadNo As Long) As Boolean
Dim bolShowLoadBuildDlg As Boolean
On Error Resume Next
bolShowLoadBuildDlg = ShowLoadBuildDlg(lngTH, Weight, TableNo, LoadNo)
MsgBox bolShowLoadBuildDlg, 0, "ShowLoadBuildDlg"
End Function
The message box from the MODULE portion of the .dll returns a TRUE value for bolShowLoadBuildDlg. I need to get that TRUE value passed back to the Result in the VBScript script.
I'm sure there is a cleaner, easier, 'more correct' way to do this, but I'm kind of stuck doing things this way. Any pointers for a non-scripter trying to write script?
Thanks in advance for the help!
Joe