<XML総合 part="3"/>
■ このスレッドは過去ログ倉庫に格納されています
0425デフォルトの名無しさん
2009/09/17(木) 14:12:01そうですね、ソースのその部分を載せてみます
VOID XmlTest() {
MSXML4::IXMLDOMDocument* w_lpDocument;
MSXML4::IXMLDOMElement* w_lpRoot;
MSXML4::IXMLDOMNode* w_lpNode;
TCHAR w_szAppPath[MAX_PATH];
std::wstring w_strAppPath;
std::wstring w_strXmlFile;
_variant_t w_varText(_TEXT("ChangeTestText"));
::GetModuleFileName(NULL, w_szAppPath, MAX_PATH);
w_strAppPath = w_szAppPath;
w_strXmlFile = w_strAppPath.substr(0, (w_strAppPath.rfind(_TEXT('\\')) + 1));
w_strXmlFile += _TEXT("Test.xml");
::CoInitialize(NULL);
if (SUCCEEDED(CoCreateInstance(MSXML4::CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
MSXML4::IID_IXMLDOMDocument, (LPVOID*)(&w_lpDocument)))) {
w_lpDocument->async = VARIANT_FALSE;
if(w_lpDocument->load(_variant_t(_TEXT("XMLファイルのパス"))) == VARIANT_TRUE) {
w_lpRoot = w_lpDocument->documentElement;
w_lpNode = w_lpRoot->firstChild; ←※ここでエラー
w_lpNode->nodeValue = w_varText.GetVARIANT();
w_lpDocument->save(_variant_t(w_strXmlFile.c_str()));
}
w_lpDocument->Release();
}
::CoUninitialize();
}
■ このスレッドは過去ログ倉庫に格納されています