Solved

ELHAPI32.DLL

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

737 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