Solved

How to deal with VB ByRef in Delphi

Posted on 2004-08-02
2
641 Views
Last Modified: 2010-04-05
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
Comment
Question by:flight5132003
2 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 250 total points
ID: 11694795
guess

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

meikl ;-)

0
 

Author Comment

by:flight5132003
ID: 11694832
Thanks Meikl!

Worked like a charm!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

16 Experts available now in Live!

Get 1:1 Help Now