The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read". Click on OK to terminate the program.
Following are some of the features in my program:
* i have to plot 7 different charts (one in each dialog box) with the data taken from 6 different text files. All the 7 charts have to be displayed in parallel and hence i am using the "modeless" method
* i am calling the main dialog box from "InitInstance" function using "DoModal()" and then i am creating objects for other dialog boxes inside the main dialog box. The code looks something like this:-
Code: Select all
BOOL CTest2App::InitInstance()
{
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
nbiq_dialog1 nbiq_dlg1;
m_pMainWnd = &nbiq_dlg1;
int nResponse = nbiq_dlg1.DoModal();
return FALSE;
}
Code: Select all
BOOL nbiq_dialog1::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
PlotNBIQSpectrum();
nbiq_dialog2 *nbiq_dlg2;
nbiq_dlg2 = new nbiq_dialog2;
nbiq_dlg2->Create(IDD_NBIQ_DIALOG1,this);
nbiq_dlg2->ShowWindow(1);
return TRUE; // return TRUE unless you set the focus to a control
}
* i am using "COleSafeArray" data type and "AddArray" function to plot the line charts. I then use the "clear" function of "COleSafeArray" class at the end of each file to clear the contents
Can someone throw some light on this issue? I have been facing this problem over past 1 week and i am not able to trace the problem.
PS: i am a newbie to C++ and MFCs. I have learned to do all this only by looking at example projects and by going through this forum.
Thanks,
Hari