Solved

How do I convert VB6 call to Delphi 6

Posted on 2003-12-11
2
495 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Making delphi communicate with a c# service 16 103
Magic Software info 18 132
How to debug For loops? 3 50
Create a path if not exists 7 78
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

831 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