Hi all -
I get a "Not enough memory for operation" when I attempt to export a print job to a text file (see below). Interestingly, the text file is created when I have no parameters that I am passing to the report (I still get the error, though), but when I enter some query criteria, the export does not take place, the file isn't created, and I only get the error. I am using Crystal 8.5 Developer on Windows 2000 SP2. My export code is below. Does anyone have any idea what might be causing this?
Thanks!
Josh
I get a "Not enough memory for operation" when I attempt to export a print job to a text file (see below). Interestingly, the text file is created when I have no parameters that I am passing to the report (I still get the error, though), but when I enter some query criteria, the export does not take place, the file isn't created, and I only get the error. I am using Crystal 8.5 Developer on Windows 2000 SP2. My export code is below. Does anyone have any idea what might be causing this?
Thanks!
Josh
Code:
bool TDMMPrintReport::OutputToTxtFile(char *FullPathFileName)
{
char FormatDLL[MAX_PATH];
char DestinationDLL[MAX_PATH];
struct PEExportOptions PEExportOpt;
struct UXDDiskOptions UXDiskOpt;
HCURSOR AcursorOrg = ::SetCursor( ::LoadCursor(NULL, IDC_WAIT));
UXDiskOpt.structSize = sizeof(UXDDiskOptions);
UXDiskOpt.fileName = FullPathFileName;
PEExportOpt.StructSize = PE_SIZEOF_EXPORT_OPTIONS;
strcpy(PEExportOpt.formatDLLName, "u2ftext.dll");
PEExportOpt.formatType = UXFTextType;
PEExportOpt.formatOptions = NULL;
strcpy(PEExportOpt.destinationDLLName, "u2ddisk.dll");
PEExportOpt.destinationType = UXDDiskType;
PEExportOpt.destinationOptions = &UXDiskOpt;
SetDatabasesLocation ();
//THIS GOES THROUGH IN ALL CASES
if (!PEExportTo (PrintJob, &PEExportOpt))
{
ReportError(PrintJob);
::SetCursor( AcursorOrg);
return false;
}
//THE START OF THE PRINT JOB ALWAYS FAILS
if (!PEStartPrintJob(PrintJob, TRUE))
{
ReportError(PrintJob);
::SetCursor( AcursorOrg);
return false;
}