Solved

How do I convert VB6 call to Delphi 6

Posted on 2003-12-11
2
498 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

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!

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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