Solved

ELHAPI32.DLL

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

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now