How to Put a Document


i am using Tamino XML Server and the ActiveX API version with C++.
I want to put an xml Document into the Database.
The second parameter of the Method PutDocument is an lpDOMNode. How can i make such one? How can i put a complete xml-Document?


The parameter may be an Element node or a Document node.

To create a document you want to do the following. Create an instance of IXMLDOMDocument and then either use load or loadXML to populate it.


IXMLDOMDocument is an Interface, so it is an abstract Class. How can i get an instance of it?

How do you instantiate the ActiveX control from C++?

The low level COM way of instantiating an IXMLDOMDocument (from MSDN) is:

IXMLDOMDocument2 * pXMLDoc;
hr = CoInitialize(NULL); 
// Check the return value, hr...
hr = CoCreateInstance(CLSID_DOMDocument40, NULL, CLSCTX_INPROC_SERVER, 
       IID_IXMLDOMDocument2, (void**)&pXMLDoc);
// Check the return value, hr...
hr = pXMLDoc->QueryInterface(IID_IXMLDOMNode, (void **)&pXDN);
// Check the return value.

Yes i’ve seen it too, but the compiler returns error messages.
He does not know CLSID_DOMDocument40 and IID_IXMLDOMDocument2.

I could find those definitions in MsXml2.h under the Platform SDK [C:\Program Files\Microsoft SDK\include on my PC].

Yes it works. I had #import “msxml4.dll” and used namespace MSXML2 instead of an include of

Ok and how can i get an Instace of the Tamino Active X. I added the Tamino Active X to my Project and know i have the Class CTaminoX with all methodes of the interface. I created a pointer:

CTaminoX* pTaminoX = new CTaminoX();

and then i initialize it:


But i get an Access Violation.

What is wrong?

What sort of VC++ project are you building?

Could you provide a copy of the .h/.cpp TaminoX files that are generated for you?

I build a SDI-Application.

CTaminoActiveX.h/CTaminoActiveX.cpp attached as zip.

[This message was edited by markk on 09 Jul 2003 at 13:01.] (3.82 KB)

Ok i have an idea!

The class CTaminoActiveX has a superclass CWnd.
If i debug the program, the handle of the CWnd within the Pointer to the CTaminoActiveX is null.
Do i have to call the CWnd-Methode Create() first?

I’m no specialist with such stuff but I suspect that there is a missing Create call? The following worked for me without error:

In default method CMFCAppApp::InitInstance():

tamx = new CTaminoX();
tamx->Create(TEXT("TaminoX"), "TaminoX", WS_CHILD | WS_VISIBLE, CRect(0, 0, 20, 20), m_pMainWnd, 1234);

Is there a reason why you want to use C++? You could try using VB first. It is a lot easier to get going and do things (see how small the VB samples are).

[This message was edited by markk on 09 Jul 2003 at 13:26.]

Thanks a lot markk!