[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

c++ data type to Delphi

Posted on 2004-09-20
5
Medium Priority
?
248 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

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

656 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