I'm kind of new to cpp so maybe you guys can save my day...
I need to create a simple xml and save it into an existing memory mapped file. This is what I have so far (removed all error checking etc.):
HANDLE hFile = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, _identifier);
LPCTSTR buffer = (LPCTSTR)MapViewOfFile(hFile, FILE_MAP_ALL_ACCESS, 0, 0, MAP_FILE_SIZE);
IStream *stream;
HRESULT res = CreateStreamOnHGlobal(NULL, TRUE, &stream);
IXmlWriter *pWriter;
res = CreateXmlWriter(__uuidof(IXmlWriter), (void**) &pWriter, NULL);
res = pWriter->SetOutput(stream);
res = pWriter->WriteStartElement(NULL, _T("Root"), NULL);
res = pWriter->WriteString(_T("12345"));
res = pWriter->Flush();
Now I have no idea what to do next. Can someone please help me getting the stream data into the mapped memory file?