Returns the indexed prefix in the current context. Used for enumeration, this method requests all available prefixes in the current context. The set of prefixes begins at 0. The index value for a prefix can change as the current context changes.
HRESULT _getDeclaredPrefix [in] long nIndex, [in, out] wchar_t* pwchPrefix, [in, out] int* ppchPrefix);
ppchPrefix
is NULL.MSXML2::IMXNamespaceManagerPtr PtrIMXNamespaceManager; HRESULT hres; TCHAR Buffer[100]; unsigned short WideCharBuffer[100]; int BufferLength = 100; try { PtrIMXNamespaceManager.CreateInstance( _ __uuidof(MSXML2::MXNamespaceManager)); PtrIMXNamespaceManager->declarePrefix(_T("sample"),_T("urn")); PtrIMXNamespaceManager->declarePrefix(_T("a"),_T("abc")); _itot(PtrIMXNamespaceManager->getDeclaredPrefixes()->length, _ Buffer, BufferLength); DisplayMessageToUser(Buffer); BufferLength = 100; PtrIMXNamespaceManager->_getDeclaredPrefix(2, WideCharBuffer, _ &BufferLength); DisplayMessageToUser(_bstr_t(WideCharBuffer)); BufferLength = 100; PtrIMXNamespaceManager->_getPrefix(L"urn", 1, WideCharBuffer, _ &BufferLength); DisplayMessageToUser(_bstr_t(WideCharBuffer)); BufferLength = 100; hres = PtrIMXNamespaceManager->_getURI(L"sample", NULL, _ WideCharBuffer, _ &BufferLength); DisplayMessageToUser(_bstr_t(WideCharBuffer)); } catch(...) { DisplayMessageToUser("Error"); } } void DisplayMessageToUser(char *Msg) { ::MessageBox(NULL, Msg, _T("Message"), MB_OK);
Returns a prefix value stored in a character buffer that is a null-terminated wide string accompanied by the length
parameter. The length, ppchPrefix
, parameter contains the size of the buffer on input and the length, not including the null character, of a result on output. If the pointer to the buffer is NULL, ppchPrefix
contains the required buffer size.
Applies to: IMXNamespaceManager