Returns the value of an input record field.
HRESULT STDMETHODCALLTYPE GetValue(IN DWORD fIndex, OUT VARIANT *pvarValue);
value = GetValue(fIndex);
Declared Field Type | C++ VARIANT Type | VBScript Type |
---|---|---|
INTEGER | VT_I8 (also compatible: VT_I4) | Long (VT_I4) |
REAL | VT_R8 | Double (VT_R8) |
STRING | VT_BSTR | String (VT_BSTR) |
TIMESTAMP | VT_DATE (also compatible: VT_I8, VT_I4 containing the number of 100-nanosecond intervals since January 1, year 0) | Date (VT_DATE) |
NULL | VT_NULL (also compatible: VT_EMPTY) | Null (VT_NULL) |
C++ example:
HRESULT CProcessesInputContext::GetValue(IN DWORD fIndex, OUT VARIANT *pvarValue) { // Initialize return value VariantInit( pvarValue ); switch(fIndex) { case 0: { // ImageName V_VT( pvarValue ) = VT_BSTR; V_BSTR( pvarValue ) = SysAllocString( m_processEntry32.szExeFile ); break; } case 1: { // PID V_VT( pvarValue ) = VT_I4; V_I4( pvarValue ) = m_processEntry32.th32ProcessID; break; } case 2: { // ParentPID V_VT( pvarValue ) = VT_I4; V_I4( pvarValue ) = m_processEntry32.th32ParentProcessID; break; } case 3: { // Threads V_VT( pvarValue ) = VT_I4; V_I4( pvarValue ) = m_processEntry32.cntThreads; break; } } return S_OK; }VBScript example:
Function GetValue(nFieldIndex) Select Case nFieldIndex Case 0 ' QFE GetValue = m_objQFEArray(m_nIndex).HotFixID Case 1 ' Description GetValue = m_objQFEArray(m_nIndex).Description Case 2 ' InstallDate GetValue = m_objQFEArray(m_nIndex).InstallDate Case 3 ' InstalledBy GetValue = m_objQFEArray(m_nIndex).InstalledBy Case 4 ' Comments GetValue = m_objQFEArray(m_nIndex).FixComments Case 5 ' SP GetValue = m_objQFEArray(m_nIndex).ServicePackInEffect End Select End Function
© 2004 Microsoft Corporation. All rights reserved.