Accessing Built-in Properties in Microsoft Visual C++/#import
- Updated2025-07-23
- 1 minute(s) read
In Microsoft Visual C++, the #import directive generates methods for accessing the values of the built-in properties for each TestStand class. The following C++ code obtains the value of the Name property from a Sequence object:
void Example (LPDISPATCH sequenceDisp){
TS::SequencePtr sequence = sequenceDisp;
_bstr_t nameString = sequence->GetName();
}
The following code obtains a reference to a step in a sequence the Sequence object references:
void Example (LPDISPATCH sequenceContextDisp){
TS::SequenceContextPtr sequenceContext = sequenceContextDisp;
TS::SequencePtr sequence;
TS::StepPtr step;
sequence = sequenceContext->GetSequence();
step = sequence->GetStep(2, TS::StepGroup_Main);
}