flight5132003
asked on
How to deal with VB ByRef in Delphi
I am in the process of converting a VB program to Delphi. There are many calls to an external DLL that need to be made. One of these functions is:
Declare Function rtdGetParams Lib "rtdsdk.dll" (ByVal nBoardNum As Integer, ByVal nParamNum As Integer, ByRef lpParamVal As Long) As Integer
And its' use in the VB program is:
If (rtdGetParams(0, CURRENT_POSITION, lpCurrPos) = VP_BS_ERROR) Then
IDC_TIMER.Enabled = False
MsgBox "rtdGetParams(CURRENT_POSI TION) Failure", vbIconStop, "Error Report"
nBoardState = VP_BS_ERROR
IDC_TIMER.Enabled = False
Else
IDC_SCROLLBAR_CURRENT_FRAM E.Value = lpCurrPos
End If
The question is: How do I convert the first line to work with Delphi?
Tom
Declare Function rtdGetParams Lib "rtdsdk.dll" (ByVal nBoardNum As Integer, ByVal nParamNum As Integer, ByRef lpParamVal As Long) As Integer
And its' use in the VB program is:
If (rtdGetParams(0, CURRENT_POSITION, lpCurrPos) = VP_BS_ERROR) Then
IDC_TIMER.Enabled = False
MsgBox "rtdGetParams(CURRENT_POSI
nBoardState = VP_BS_ERROR
IDC_TIMER.Enabled = False
Else
IDC_SCROLLBAR_CURRENT_FRAM
End If
The question is: How do I convert the first line to work with Delphi?
Tom
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worked like a charm!