IGetPreferencesRsp::GetPreference

The GetPreference method returns the value of the site preference specified using XPath syntax.

_bstr_t bstrPreference = spIGetPreferencesRsp->GetPreference(_bstr_t bstrXPathPreference);
Parameters
bstrXPathPreference - [in] Required _bstr_t, which specifies the site preference value to retrieve. The site name must be specified using XPath syntax.
Results
Returns a _bstr_t, which contains the value for the requested site preference.
Sample
The following is a fragment from the complete example for the GetPreferences command.
   ...
   // Initialize the custom GetPreferences command component
   // with the type of preferences to retrieve.
   PreferencesType prefType = ePreferencesTypeBootstrap;
   std::cout << "Initializing the GetPreferences command component..." << std::endl;
   spIGetPreferencesCmd->Initialize(PrefType);

   // Execute the GetPreferences command and capture the response component
   std::cout << "Executing the GetPreferences command..." << std::endl;
   IAppIntCmdPtr spIAppIntCmd(spIGetPreferencesCmd);
IAppIntRspPtr spIAppIntRsp = spIAppIntCmd->Invoke(spIAppIntSession);
... // Obtain the specific response information contained in the custom GetPreferencesRsp component IGetPreferencesRspPtr spIGetPreferencesRsp(spIAppIntRsp);
_ASSERTE(spIGetPreferencesRsp != 0);
std::cout << "PreferencesXML=" << (LPCSTR) spIGetPreferencesRsp->GetPreferencesXML() << std::endl; _bstr_t bstrXPathPreference = (_T("/Document Name")); _bstr_t bstrPreference = spIGetPreferencesRsp->GetPreference(bstrXPathPreference);
std::cout << "DocumentName=" << (LPCSTR) bstrPreference << std::endl; ...