Solved

ELHAPI32.DLL

Posted on 2013-06-20
6
834 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 47

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

734 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