Solved

How do I convert VB6 call to Delphi 6

Posted on 2003-12-11
2
494 Views
Last Modified: 2007-12-19
The VB call from the vendor example to the vendor's API is:

' * SetInteractiveMode
Declare Function SetInteractiveMode Lib "ICE_API" Alias "_SetInteractiveMode@8" ( _
    ByVal hdc As Long, _
    ByVal bEnable As Long _
) As Long

My stab at this, which doesn't work, follows:

//' * SetInteractiveMode
function SetInteractiveMode(hdc: HDC; bEnable: boolean): boolean; StdCall; External 'ICE_API.dll';

The code from the ICE_API.h file is:
/*
 * SetInteractiveMode
 */
BOOL ICEAPI SetInteractiveMode(HDC /*hDC*/,
                               BOOL /*bEnable*/);

How do I make this work in Delphi 6?
0
Comment
Question by:terencenky
2 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 250 total points
ID: 9924120

// Delphi declaration
//   Notes:   BOOL is defined in Windows.pas as LongBool, thus the VB use of Long
//            Make sure to include the "mangled" name at the end of the external
//
function SetInteractiveMode(hDC: HDC; bEnable: BOOL): BOOL; stdcall; external 'ice_api.dll' name '_SetInteractiveMode@8';

Regards,
Russell


0
 

Author Comment

by:terencenky
ID: 9924460
Russell,

Thanks a bunch!!  Great response time!!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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…

706 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

18 Experts available now in Live!

Get 1:1 Help Now