Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax problem. Sets and enums.Delphi component in c++Builder

Status
Not open for further replies.

Tremorblue

Programmer
Apr 30, 2004
56
GB
I am using the on guard component from turbo power.
A function called CreateMachineID is defined as...

extern PACKAGE int __fastcall CreateMachineID(TEsMachineInfoSet MachineInfo);

Now a TEsMachineInfoSet is defined as

typedef Set<OnGuard__1, midUser, midDrives> TEsMachineInfoSet;

Where OnGuard__1 is defined as

#pragma option push -b-
enum OnGuard__1 { midUser, midSystem, midNetwork, midDrives };
#pragma option pop

What I want to do is call CreateMachineID(midUser+midSystem);

I get an Error cannot convert OnGuard__1 to TEsMachineInfoSet. Type mismatch...

Any ideas much appreciated !
 
I see that the TEsMachineInfoSet is a customized template class from Set. So CreateMachineID method wants class parameter, not sum of two enums. The correct code is:

CreateMachineID(TEsMachineInfoSet() << midUser << midSystem);

Look online help for using templates and pure C++ classes.

unbornchikken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top