• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 695
  • Last Modified:

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
0
flight5132003
Asked:
flight5132003
1 Solution
 
kretzschmarCommented:
guess

Function rtdGetParams(nBoardNum : Integer; nParamNum : Integer, var lpParamVal : Integer) : Integer;
begin....

meikl ;-)

0
 
flight5132003Author Commented:
Thanks Meikl!

Worked like a charm!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now