Hello,
I'm creating a spreadsheet to script keystrokes into SMART and would like to use the "QueryCursorLocation" to help determine when Rumba is ready to receive input. However, I'm constantly returning a #9 System Error when I try to use Function 7 (QueryCursorLocation). My other Functions are working fine. Can you tell what I'm doing wrong? Below is a sample of the Macro I'm using to test the results of each function.
(I'm modifying a sample macro I found in other forum posts, but it has been very useful to me)
Micro Focus Rumba - Version 8.0.0 SP0 Patch0
'START EXCEL VBA MACRO; COPY/PASTE this in a new Excel VBA Module and make sure your WHLLAPI.DLL file paths are accurate
Private Declare Function WinHLLAPIStartup Lib "C:\\Program Files (x86)\\Micro Focus\\RUMBA\\system\\WHLLAPI.DLL" (ByVal Version%, ByVal Buffer$) As Long
Private Declare Function WinHLLAPI Lib "C:\\Program Files (x86)\\Micro Focus\\RUMBA\\system\\WHLLAPI.DLL" (Func%, ByVal Buffer$, bSize%, RetC%) As Long
Private Declare Function WinHLLAPICleanup Lib "C:\\Program Files (x86)\\Micro Focus\\RUMBA\\system\\WHLLAPI.DLL" () As Long
Sub Test()
ShortNameIndex = 257
ShortNameList = Space(100)
WinHLLAPIStartup ShortNameIndex, ShortNameList
Func = 1 '(ConnectPresentationSpace)
Astr = "A"
Alen = 1
WinHLLAPI Func, Astr, Alen, RetC
'MsgBox "Func " & Func & ": RetC = " & RetC
Func = 3 '(SendKey)
Astr = "@4HELLO"
Alen = 7
WinHLLAPI Func, Astr, Alen, RetC
'MsgBox "Func " & Func & ": RetC = " & RetC
Func = 7 '(QueryCursorLocation)
Astr = ""
Alen = 0
WinHLLAPI Func, Astr, Alen, RetC
MsgBox "Func " & Func & ": Alen = " & Alen & ", RetC = " & RetC
Arow = Int(Alen / 80) 1
Acol = Alen Mod 80
MsgBox "Row = " & Arow & ", Col = " & Acol
Func = 6 '(SearchPresentationSpace)
Astr = "HELLO"
Alen = Len(Astr)
RetC = 1
WinHLLAPI Func, Astr, Alen, RetC
'MsgBox "Func " & Func & ": RetC = " & RetC & ": Location = " & Alen
WinHLLAPICleanup
End Sub
Thank you for your help.
#Rumba





