Link to home
Start Free TrialLog in
Avatar of flight5132003
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_POSITION) Failure", vbIconStop, "Error Report"
        nBoardState = VP_BS_ERROR
        IDC_TIMER.Enabled = False
    Else
        IDC_SCROLLBAR_CURRENT_FRAME.Value = lpCurrPos
    End If

The question is: How do I convert the first line to work with Delphi?

Tom
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of flight5132003
flight5132003

ASKER

Thanks Meikl!

Worked like a charm!