I have data stored in a CString and it needs to be parsed by an XML parser library. The problem is the XML parser takes in a CFile. It’s not ideal to write out the CString to a text file and then reload it into a CFile. Is there any way to directly send the CString to the CFile without making an intermediate output file?
I have data stored in a CString and it needs to be parsed by
Share
You should be able to use CMemFile to accomplish this. It inherits from
CFileand allows you to specify an arbitrary buffer for data. The following sample code should work: