Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I convert VB6 call to Delphi 6

Posted on 2003-12-11
2
Medium Priority
?
514 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 1000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

715 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