Microsoft Internet Security and Acceleration Server 2000 |
Using this procedure, add code to save the filter configuration data in the vendor parameter set.
To save the filter configuration data in the vendor parameter set
HRESULT PutVendorData(FPCLib::IFPCApplicationFilterPtr spiApplicationFilter, const _bstr_t& bsVirusString, const _bstr_t& bsPrefixString, const _bstr_t& bsSMTPIPAddress) { HRESULT hr = S_OK; FPCLib::IFPCVendorParametersSetsPtr spIFPCVendorParametersSets; FPCLib::IFPCVendorParametersSetPtr spIFPCVendorParametersSet; try { spIFPCVendorParametersSets = spiApplicationFilter->VendorParametersSets; try { spIFPCVendorParametersSet = spIFPCVendorParametersSets->Item(_bstr_t(PARAM_SET_GUID)); } catch(_com_error&) { //Create a new parameter set spIFPCVendorParametersSet = spIFPCVendorParametersSets->Add(_bstr_t(PARAM_SET_GUID),VARIANT_FALSE); spIFPCVendorParametersSets->Save(); } spIFPCVendorParametersSet->Value[_bstr_t("VirusString")] = bsVirusString; spIFPCVendorParametersSet->Value[_bstr_t("PrefixString")] = bsPrefixString; spIFPCVendorParametersSet->Value[_bstr_t("SMTPIPAddress")] = bsSMTPIPAddress; spIFPCVendorParametersSet->Save(); } catch(_com_error& err) { return err.Error(); } return S_OK; }
// This member function is called when the user clicks the OK or the Apply button. virtual BOOL OnApply() { HRESULT hr; // _bstr_t bsVirusString, bsPrefixString; char sVirusString[100], sPrefixString[100]; ::GetWindowTextA (::GetDlgItem (m_hWnd, IDC_VIRUS_STRING), reinterpret_cast <char *> (&sVirusString), 100); ::GetWindowTextA (::GetDlgItem (m_hWnd, IDC_PREFIX_STRING), reinterpret_cast <char *> (&sPrefixString), 100); hr = ::PutVendorData (m_spiApplicationFilter, _bstr_t(sVirusString), _bstr_t(sPrefixString)); return TRUE; }