AV When Exporting To PDF
I'm getting an AV when I Load a report, save to pdf, exit and re load the report. The AV is occuring on the following line of my code,
((TfrxMemoView*)frxReport->FindObject("Memo4"))->Text = cmbProducts->Items->Strings[cmbProducts->ItemIndex];
And in fact, ((TfrxMemoView*)frxReport->FindObject("Memo4")) = NULL the second time my code runs.
The AV doesn't occur if I set frxPDFExport1->ShowDialog to false though (but then the user can't choose a directory to save the file to)!!
Any ideas anyone?
Thanks,
Andy
((TfrxMemoView*)frxReport->FindObject("Memo4"))->Text = cmbProducts->Items->Strings[cmbProducts->ItemIndex];
And in fact, ((TfrxMemoView*)frxReport->FindObject("Memo4")) = NULL the second time my code runs.
The AV doesn't occur if I set frxPDFExport1->ShowDialog to false though (but then the user can't choose a directory to save the file to)!!
Any ideas anyone?
Thanks,
Andy
Comments
I've sussed this out and I'm not sure if it constitutes a bug or not! It could (and probably will) be pushed into the "Intended Behaviour" pile.
Basically, I load a report using the following,
frxReport->LoadFromFile("Data\\99\\PartInfo.qha");
Set up some titles and ->ShowReport
If the user decides to Export the report and uses the Save As dialog then FastReports is actually changing the Current Directory to the one the user selects. So, when I next load my report, it doesn't load (and I didn't check that it loaded correctly but I probably should have!),
frxReport->LoadFromFile("Data\\99\\PartInfo.qha");
My current directory isn't what it was!
Bug or Intended Behaviour? I know where I'll put my money
Andy
Apologies for wasting posting space
Andy