|
void __fastcall TFrmMain::Button1Click(TObject *Sender)
{
m_pCustPreview = new TFrmResultViewMain(this); //검사 결과 화면
MakeAndPreviewAttentionReport();
MakeAndPreviewMemoryReport();
MakeAndPreviewMotorReport();
MakeAndPreviewPerformanceReport();
MakeAndPreviewReactionTimeReport();
//Report 제작
m_pCustPreview->m_pFirstPage->QuickRep1->OnPreview = CustomPreview;
m_pCustPreview->m_pFirstPage->QuickRep1->Preview();
}
void __fastcall TFrmMain::CustomPreview(TObject *Sender)
{
m_pCustPreview->QRPreview1->QRPrinter = (TQRPrinter*) Sender;
m_pCustPreview->Show();
}
void __fastcall TFrmMain::MakeAndPreviewPerformanceReport()
{
if(m_pCustPreview->m_pReportGraph!=NULL) {
m_pCustPreview->m_pReportGraph->Free(); // by BooOne
}
m_pCustPreview->m_pReportGraph = new TFrmReportGraph(m_pCustPreview);
}
void __fastcall TFrmMain::MakeAndPreviewReactionTimeReport()
{
if(m_pCustPreview->m_pReportGraph2!=NULL) {
m_pCustPreview->m_pReportGraph2->Free(); // by BooOne
}
m_pCustPreview->m_pReportGraph2 = new TFrmReportGraph(m_pCustPreview);
}
폼은 메인 폼, 리포트 메인(QRPreview1콤포넌트 사용된 페이지), 그리고 여러개의 퀵레포트로 구성된 폼들이 있습니다.
문제 없이 돌아가기는 잘 돌아가는데
어떻게 메모리에서 해제시켜줘야 될지를 모르겠습니다.
마지막에 메모리 억세스 에러가 나거든요..
좀 도와주셨으면 합니다.
좋은 하루 되시길...
|