Sample Input Code
Example
C++
LPCWSTR wszRequest = L"<request>\n" +
L" <data>\n" +
L" <organizations>\n" +
L" <organization name=\"tailspintoys.com\"/>\n" +
L" </organizations>\n" +
L" </data>\n" +
L" <context>\n" +
L" <clientContext clientTransactionId=\"53367B03-63D3-44ae-B8AD-C1E57E876E6C\"/>\n" +
L" </context>\n" +
L"</request>";
IProvEngine * pProvEngine = NULL;
BSTR bstrRequest = ::SysAllocString(wszRequest);
BSTR bstrNamespace = ::SysAllocString(L"Test Namespace");
BSTR bstrProcedure = ::SysAllocString(L"Write Request");
BSTR bstrRetValue = NULL;
HRESULT hr = E_OUTOFMEMORY;
if(bstrRequest && bstrNamespace && bstrProcedure)
{
// Create engine client:
hr = CoCreateInstance(CLSID_ProvEngineClient, NULL, CLSCTX_ALL, IID_IProvEngine, (void**)(&pProvEngine));
if(hr == S_OK)
{
hr = pProvEngine->SubmitRequest(bstrRequest, bstrNamespace, bstrProcedure, &bstrRetValue);
pProvEngine->Release();
}
}
// Get the error description in the case of error
if(FAILED(hr))
{
IErrorInfo* pErrInfo = NULL;
if(::GetErrorInfo(0, &pErrInfo) == S_OK && pErrInfo)
{
pErrInfo->GetDescription(&bstrRetValue);
pErrInfo->Release();
}
}
// Show the results
MessageBoxW(NULL, bstrRetValue ? bstrRetValue : L"Unknown error occured", L"Request results", MB_OK);
// Clean up
::SysFreeString(bstrRequest);
::SysFreeString(bstrNamespace);
::SysFreeString(bstrProcedure);
::SysFreeString(bstrRetValue);
Sample Output Code
- Zero-Indicates success.
- Non zero-Represents an error. For a list of error codes,
see MPF
Errors.