Sometimes I need to deal with huge PDF files, in such case, I use some new operator in a loop, and this is a so huge loop so that more than 10 GB memory will be used. As we all know, I must use some WIN API functions to use hard disk. But I don't know how to implement it. Anyone can help me?
Here is a code snippet:
CMyObject gg_data;
for(__int64 i = 0; i < up_limit(__int64); ++i)
{
//add new data to the PDF file
CCAry pData = new CCAry("myData");
gg_data.AddRef(pData);
}
//after the loop, save file and free memory so that no memory leaks occur...
//Caution: the "save" is a very expensive work, it will take several hours!!!
gg_data.save();