Symbian
Symbian OS Library

FAQ-0859 How do I tell the compiler to use the TProcessPriority enum and not the ones in CActive?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Base
Created: 03/27/2003 Modified: 04/11/2003
Number: FAQ-0859
Platform: Not Applicable

Question:
CActive defines an enum of priorities with the same names as the global TProcessPriority enum. This can sometimes lead to the compiler assuming the CActive one when the TProcessPriority was intended. How do I make the compiler use the right one?

Answer:
You can force the compiler to use the right one by using the :: construct to tell it the class/namespace the enum you want resides in, for example:

    CActive::EPriorityHigh
    ::EPriorityHigh // use TProcessPriority

    (Note that omitting the namespace/class name before the double colon means the global namespace).

    So for example:

    someProcess.SetPriority( ::EPriorityHigh );