?
Solved

c++ data type to Delphi

Posted on 2004-09-20
5
Medium Priority
?
246 Views
Last Modified: 2010-04-05
I'm going through a c++ header file converting data types and I am stuck on this one.. Anybody know how to translate this to Delphi?

typedef union RhtFeatureValue_u
{
    ULONG                   Integer;         // integer values (char, short, int, long)
    ULONG                   Enumeration;     // enumerated types
    ULONG                   BitMap;          // bit-mapped values

    UCHAR                   Reserved[16];    // Maximum of 128 bits.
} RHT_FEATURE_VALUE_U, *PRHT_FEATURE_VALUE_U;
0
Comment
Question by:rbohac
[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
  • 3
5 Comments
 
LVL 4

Expert Comment

by:Evarest
ID: 12103983
This should be it (not 100% sure about RHT_FEATURE_VALUE_U)

PRhtFeatureValue = ^TRhtFeatureValue;
TRhtFeatureValue = record
 int: ULONG;
 Enumeration: ULONG;
 Bitmap: ULONG;
 Reserved: array [0..15] of char; // or string[16];
end;

Hope this helps,
Evarest
0
 
LVL 6

Author Comment

by:rbohac
ID: 12104029
Since it's a union type (and not a struct), shouldn't is look something like:

TRhtFeatureValue = record
  case integer of....
0
 
LVL 4

Expert Comment

by:Evarest
ID: 12104087
If i look at the following thread, I didn't think that the case integer of is needed...

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_11378818.html

I don't really know...
Evarest
0
 
LVL 4

Expert Comment

by:Evarest
ID: 12104151
Sorry, my mistake. rbohac gets the points as he correctly stated that the case integer of is needed. See for example:

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20952048.html?query=typedef+union&topics=85

Kind regards,
Evarest
0
 
LVL 6

Accepted Solution

by:
vadim_ti earned 500 total points
ID: 12104274

  RHT_FEATURE_VALUE_U = record
    case Integer of
      0: _Integer:Cardinal;
      1: _Enumeration:Cardinal;
      2: _BitMap:Cardinal;
      3: _Reserved: array [0..15] of Char;
  end;
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

801 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