Acquiring a Derived Class from the PropertyObject Class in Microsoft Visual C++/#import
- Updated2025-07-23
- 1 minute(s) read
In Microsoft Visual C++, you can use a class the #import directive generates to acquire a derived class from a dynamic property the PropertyObject class returns.
The following code uses a lookup string to obtain a reference to a Step object from the sequence context:
void Example (LPDISPATCH seqContextDisp){
TS::SequenceContextPtr sequenceContext = seqContextDisp;
TS::PropertyObjectPtr property;
TS::StepPtr step;
property = sequenceContext->AsPropertyObject();
step = property->GetPropertyObject("RunState.Sequence.Main[2]",0);
}