Template:AVO Sample of trace properties

From AVObjects Knowledge Base
(Difference between revisions)
Jump to: navigation, search
(Trace all object's properties)
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 
===Trace all object's properties===
 
===Trace all object's properties===
 
<source lang=cpp>
 
<source lang=cpp>
  //Query IAVProperties interface
+
//Query IAVProperties interface
  CComQIPtr<IAVProperties> spProps(spObject);
+
CComQIPtr<IAVProperties> spProps(spObject);
 
 
  //Get list name=value pairs separated CR
+
//Get list name=value pairs separated CR
  //for all properties of object
+
//for all properties of object
  CComBSTR cbsPropsList;
+
CComBSTR cbsPropsList;
  HRESULT hr = spProps->PropsGet(L"\n", cbsPropsList);
+
HRESULT hr = spProps->PropsGet(L"\n", cbsPropsList);
  ATLASSERT(hr == S_OK);
+
ATLASSERT(hr == S_OK);
  
  //Trace properties
+
//Trace properties
  ATLTRACE2(atlTraceGeneral, 2, L"Properties for spObject:\n%ls\n",  
+
ATLTRACE2(atlTraceGeneral, 2, L"Qbject's properties:\n%s\n",  
spPropsList);
+
  spPropsList);
 
</source>
 
</source>

Latest revision as of 08:42, 11 July 2014

Trace all object's properties

//Query IAVProperties interface
CComQIPtr<IAVProperties> spProps(spObject);
 
//Get list name=value pairs separated CR
//for all properties of object
CComBSTR cbsPropsList;
HRESULT hr = spProps->PropsGet(L"\n", cbsPropsList);
ATLASSERT(hr == S_OK);
 
//Trace properties	
ATLTRACE2(atlTraceGeneral, 2, L"Qbject's properties:\n%s\n", 
  spPropsList);
Personal tools