xLeaves
05-08-2019, 13:08
I need to use a COM DLL to get the mouse position (of course, this function is not important, because many functions need to use formal parameters, just use this function to reproduce this problem).
The code called in VBScript is as follows:
Dim x, y
Dim dm
set dm = CreateObject("dm.dmsoft")
Call dm.GetCursorPos(x, y)
MsgBox x & "_" & y
It can get the results correctly. If you use a 64-bit operating system, you need to change the VBS runtime environment to 32-bit first.
Dim dm As iDispatch = NewCom("dm.dmsoft")
Dim As Long x, y
dm.GetCursorPos(x, y)
MsgBox(x & "_" & y)
The result is always 0, 0
ThinBasic can support some simple formal parameter passing, such as Byte, Int16, Int32, Int64, Single, Double, String, etc.
The code called in VBScript is as follows:
Dim x, y
Dim dm
set dm = CreateObject("dm.dmsoft")
Call dm.GetCursorPos(x, y)
MsgBox x & "_" & y
It can get the results correctly. If you use a 64-bit operating system, you need to change the VBS runtime environment to 32-bit first.
Dim dm As iDispatch = NewCom("dm.dmsoft")
Dim As Long x, y
dm.GetCursorPos(x, y)
MsgBox(x & "_" & y)
The result is always 0, 0
ThinBasic can support some simple formal parameter passing, such as Byte, Int16, Int32, Int64, Single, Double, String, etc.