der titel sagt das problem. ich möchte MSXML nutzen, und COM hat nicht wirklich lust mir den gefallen zu tun und ein DOMDocument zu erzeugen. CoCreateInstance() liefert egal was ich mache, E_NOINTERFACE, zurück.
code:
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#include <iostream>
#include <msxml2.h>
using namespace std;
int main()
{
if(FAILED(CoInitialize(0)))
{
cout << "nix da bei CoInit!";
cin.get();
return -1;
}
IXMLDOMDocument2 *pDoc;
HRESULT hr = CoCreateInstance(CLSID_DOMDocument30,0,CLSCTX_INPROC_SERVER,IID_IXMLDocument2,(void**)(&pDoc));
if(FAILED(hr))
{
switch(hr)
{
case REGDB_E_CLASSNOTREG: cout << "REGDB_E_CLASSNOTREG"; break;
case CLASS_E_NOAGGREGATION: cout << "CLASS_E_NOAGGREGATION"; break;
case E_NOINTERFACE: cout << "E_NOINTERFACE"; break;
}
cin.get();
return -1;
}
pDoc->Release();
CoUninitialize();
return 0;
}
|
verwenden tu ich MSXML3. ich auch 6 versucht, aber so wirklich half mir das nicht weiter. ideen?