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
Solved

Converting C header files to Delphi

Posted on 2004-03-23
8
338 Views
Last Modified: 2010-04-05
I am a Delphi programmer (I don't know much about C) and I'm trying to write a program that works with a finger print reader that uses the bioapi (www.bioapi.org) interface specification.  As such, I have to convert the bioapi C include header files to Delphi (unless someone knows an easier way to do this)...and I need some help.

Here's an example that I need help converting (this is from the bioapi_type.h file).  I know the union statement converts to a Delphi case statement by I'm not sure how to structure it.

typedef struct bioapi_candidate
{
      BioAPI_IDENTIFY_POPULATION_TYPE Type;
      union
      {
            BioAPI_UUID_PTR BIRInDataBase;
            uint32 *BIRInArray;
      } BIR;
      BioAPI_FAR FARAchieved;
      BioAPI_FRR FRRAchieved;
} BioAPI_CANDIDATE, *BioAPI_CANDIDATE_PTR;
0
Comment
Question by:rwcochran
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 40 total points
ID: 10660233

Need to fix the 2 types BioAPI_UUID_PTR and BioAPI_FAR (not enough info given to determine what they are supposed to be), other than that, the rest should be correct.

// Need the correct declarations for the following 2 types
type
  BioAPI_UUID_PTR   =  Pointer;
  BioAPI_FAR        =  Pointer;

type
  BioAPI_IDENTIFY_POPULATION_TYPE  =  packed record
     case Integer of
        0  :  (BIRInDataBase:   BioAPI_UUID_PTR);
        1  :  (BIRInArray:      ^LongWord);
  end;

type
  bioapi_candidate  =  packed record
     _Type:         BioAPI_IDENTIFY_POPULATION_TYPE;
     FARAchieved:   BioAPI_FAR;
     FRRAchieved:   BioAPI_FAR;
  end;
  TBioApiCandidate  =  bioapi_candidate;
  PBioApiCandidate  =  ^TBioApiCandidate;

Regards,
Russell
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 10660295
as expected, that is juz too easy for Russell ;-)
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10660434
This may also help!

http://delphi-jedi.org/team_darth_home

Shane
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 26

Expert Comment

by:Russell Libby
ID: 10660939
Nice job on the points DragonSlayer ;-)  and a C grade to boot

lmao,
Russell
0
 

Author Comment

by:rwcochran
ID: 10660974
Many thanks to rllibby for the help.  I noticed I messed up and hit the wrong Accept button and didn't give you the credit (sorry, I just signed up on the site and I'm still getting used to the procedures).  Please forgive the mistake.  I'm sure I'll have more questions and I promise not to make that mistake again.
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 10660992
The points are not big deal (truly), but watch the "C" grade.... Do it too many times, and there won't be anyone willing to touch your questions.

Kind Regards,
Russell
0
 

Author Comment

by:rwcochran
ID: 10661763
Sorry about the "C" grade DragonSlayer...just a newby mistake...it won't happen again.  By the way, is there anyway to correct it?
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 10663760
Post a message at Community Support, asking them to reopen this question and award the points to Russell instead.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
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 …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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