• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 388
  • Last Modified:

How to convert C++ API function to Delphi

Dear sirs:

Please somebody can help me to interpret the following function in C++ to convert it to DELPHI

SEECAR_RET_STATUS  FAR SEEAPI seecar_init(
            BOOL debug,                    /* enable debug info printing */
            void FAR (*fcallback)(void));         /* callback function */

SEECAR_RET_STATUS  is a enum type

SEEAPI is defined as
             #define      SEEAPI      __declspec(dllimport)

The DLL file is SeeCar.dll

Best regards.
0
mbrlaser
Asked:
mbrlaser
1 Solution
 
2266180Commented:
from the top of my head, something like:

type TProcedure=procedure;// has no params

function seecar_init(debug:boolean; fcallback:TProcedure):SEECAR_RET_STATUS; cdecl; external 'SeeCar.dll';

let me know if there are any issues with the above. I'll get home to my delphi enabled machine in about 1-2 hours.

cheers
0
 
mbrlaserAuthor Commented:
Thank You, this works fine
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now