Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ELHAPI32.DLL

Posted on 2013-06-20
6
Medium Priority
?
849 Views
Last Modified: 2013-07-22
Hi I am having an issue with using a ELHAPI function
I have it declared in my BAS Module.

Declare Function WD_Convert Lib "C:\Program Files\Micro Focus\RUMBA\System\EHLAPI32.DLL" _
                (ByVal hInstance As Long, ByVal ConvertType As Integer, ROWCOL As ROWCOL_TYPE, ByVal ShortName As String) As Long

And RowCol

' Row/Column Type
Type ROWCOL_TYPE
    Row     As Integer  'x-coordinate
    Col     As Integer  'y-coordinate
End Type

I try to run WD_Convert
Dim ShortName As String, Rows As Integer, Cols As Integer, lWnd As Long, RetC As Integer
Dim RC As ROWCOL_TYPE
Dim POS As Integer
Dim Str As String
Dim StrLn As Integer


Private Sub Command1_Click()
RC.Row = 1
RC.Col = 2
Str = "Hello"
RetC = WD_ConnectPS(lWnd, ShortName)
MsgBox RetC
RetC = WD_SendKey(lWnd, "@C")
MsgBox RetC
POS = WD_Convert(lWnd, Asc("R"), RC, ShortName)
When I run it I get a runtime error 6 at the WD_Convert function

this is VB 6.0
Please let me know if you need more information
Thanks
0
Comment
Question by:ScreenScrape
  • 2
  • 2
5 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39264502
You have declared POS as an integer while the function WD_Convert returns a Long number.

Try declaring POS as Long
0
 

Accepted Solution

by:
ScreenScrape earned 0 total points
ID: 39264634
Great, good job! my next issue is I am not sure this is returning the right position. Assigin RC.Row =1 and RC.Col = 1 POS retuens with 1769472. I get the same error msg on my next line using POS as the position to WD_WD_CopyStringToPS

Private Sub Command1_Click()
POS = 0
RC.Row = 1
RC.Col = 1
Str = "Hello"
RetC = WD_ConnectPS(lWnd, ShortName)
MsgBox RetC
RetC = WD_SendKey(lWnd, "@C")
MsgBox RetC
POS = WD_Convert(lWnd, Asc("R"), RC, ShortName)
MsgBox "Position is" & POS


RetC = WD_CopyStringToPS(lWnd, POS, Str, Len(Str))
MsgBox RetC
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39264648
Sorry, I have no knowledge of the API itself. If no-one else comments here, I suggest that you ask another question, perhaps adding more zones, if there are any others that seem appropriate.
0
 

Author Comment

by:ScreenScrape
ID: 39266524
The WD_Convert should convert row, col screen position in to a single interger position. like Row 2 Col 1 will be 80. no matter what I set RowCol for POS = 1507328

Dim ShortName As String, Rows As Integer, Cols As Integer, lWnd As Long, RetC As Integer
Dim RC As ROWCOL_TYPE
Dim POS As Long
Dim Str As String
Dim StrLn As Integer


Private Sub Command1_Click()
POS = 0
RC.Row = 2
RC.Col = 1
Str = "Hello"
RetC = WD_ConnectPS(lWnd, "Z")
MsgBox RetC
RetC = WD_SendKey(lWnd, "@C")
MsgBox RetC
Print RC.Row
Print RC.Col

POS = WD_Convert(lWnd, Asc("P"), RC, "Z")
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 39345209
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question