You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.4 KiB
72 lines
1.4 KiB
// Copyright (C) 1999-2000 Microsoft Corporation
|
|
//
|
|
// SetComError routines
|
|
//
|
|
// sburns 5-3-99
|
|
|
|
|
|
|
|
#include "headers.hxx"
|
|
#include "common.hpp"
|
|
|
|
|
|
|
|
void
|
|
SetComError(
|
|
unsigned descriptionMessageResID,
|
|
DWORD helpContext)
|
|
{
|
|
SetComError(String::load(descriptionMessageResID), helpContext);
|
|
}
|
|
|
|
|
|
|
|
void
|
|
SetComError(
|
|
const String& description,
|
|
DWORD helpContext)
|
|
{
|
|
LOG_FUNCTION2(SetComError, description);
|
|
|
|
ICreateErrorInfo* cei = 0;
|
|
HRESULT hr = S_OK;
|
|
|
|
do
|
|
{
|
|
hr = ::CreateErrorInfo(&cei);
|
|
BREAK_ON_FAILED_HRESULT(hr);
|
|
|
|
hr = cei->SetGUID(IID_IConfigureYourServer);
|
|
BREAK_ON_FAILED_HRESULT(hr);
|
|
|
|
hr = cei->SetSource(PROGID_VERSION_STRING);
|
|
BREAK_ON_FAILED_HRESULT(hr);
|
|
|
|
hr =
|
|
cei->SetDescription(
|
|
const_cast<String::value_type*>(description.c_str()));
|
|
BREAK_ON_FAILED_HRESULT(hr);
|
|
|
|
hr = cei->SetHelpFile(L"" /* HELPFILE_NAME */ );
|
|
BREAK_ON_FAILED_HRESULT(hr);
|
|
|
|
hr = cei->SetHelpContext(helpContext);
|
|
BREAK_ON_FAILED_HRESULT(hr);
|
|
|
|
SmartInterface<IErrorInfo> ei;
|
|
hr = ei.AcquireViaQueryInterface(*cei);
|
|
BREAK_ON_FAILED_HRESULT(hr);
|
|
|
|
hr = ::SetErrorInfo(0, ei);
|
|
BREAK_ON_FAILED_HRESULT(hr);
|
|
}
|
|
while (0);
|
|
|
|
if (cei)
|
|
{
|
|
cei->Release();
|
|
}
|
|
}
|
|
|
|
|
|
|