Solved

ELHAPI32.DLL

Posted on 2013-06-20
6
804 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
6 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 46

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

829 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