Skywise
asked on
Borland C++ 4.5 for Windows General Protection Exception error
Question: Can anyone help with the following problem?
I have a program built from Borland C++ version 4.5 which essentially interfaces with a fortran program, takes the data, and graphs it in several different ways. Two files are opened (calling the same subroutine) and the data is generated and then read in and graphed.
Recently a new graph was added and now, upon calling for the second file to open, the following error occurs:
General Protection Exception 0x2B17:0x380E
<Program name>(1) 0x2B17:0x380E Processor Fault
Nothing was changed in the open subroutine when the new graph was added, so this is quite a mystery.
I put breaks in and tracked the error to a line within the open subroutine which opens the first file without the error. I'll paste in the whole subroutine, with a **** on the line giving the error below.
If anybody can help with this, I would greatly appreciate it... It's a new program for me (just started a new job). Thanks in advance.
void sintautoApp::CmFileOpen ()
{
//
// Display standard Open dialog box to select a file name.
//
*FileData.FileName = 0;
FileData.SetFilter(
"Material Files (*.mat)|*.mat|Plate Files (*.plt)|*.plt|Sphere Files
(*.sph)|*.sph|Agglomerates Files (*.agg)|*.agg|");
sintautoWindow *client =
TYPESAFE_DOWNCAST(GetMainW indow()->G etClientWi ndow(), sintautoWindow);
// Client window for the frame.
if (client->CanClose())
**** if (TFileOpenDialog(GetMainWi ndow(),
FileData).Execute() == IDOK)
OpenFile();
Paint='Y';
(GetMainWindow()->GetClien tWindow()) ->Invalida te();
//MessageBox(GetMainWindow ()->HWindo w,good_pat h , "sintwin
path", MB_OK);
}
I have a program built from Borland C++ version 4.5 which essentially interfaces with a fortran program, takes the data, and graphs it in several different ways. Two files are opened (calling the same subroutine) and the data is generated and then read in and graphed.
Recently a new graph was added and now, upon calling for the second file to open, the following error occurs:
General Protection Exception 0x2B17:0x380E
<Program name>(1) 0x2B17:0x380E Processor Fault
Nothing was changed in the open subroutine when the new graph was added, so this is quite a mystery.
I put breaks in and tracked the error to a line within the open subroutine which opens the first file without the error. I'll paste in the whole subroutine, with a **** on the line giving the error below.
If anybody can help with this, I would greatly appreciate it... It's a new program for me (just started a new job). Thanks in advance.
void sintautoApp::CmFileOpen ()
{
//
// Display standard Open dialog box to select a file name.
//
*FileData.FileName = 0;
FileData.SetFilter(
"Material Files (*.mat)|*.mat|Plate Files (*.plt)|*.plt|Sphere Files
(*.sph)|*.sph|Agglomerates
sintautoWindow *client =
TYPESAFE_DOWNCAST(GetMainW
// Client window for the frame.
if (client->CanClose())
**** if (TFileOpenDialog(GetMainWi
FileData).Execute() == IDOK)
OpenFile();
Paint='Y';
(GetMainWindow()->GetClien
//MessageBox(GetMainWindow
path", MB_OK);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm not clear on what you're suggesting I try with the line where the program is crashing. You said:
%%%%% assuming you use FileData.FileName in OpenFile()
> I mean your OpenFile() routine got use the newly got file name
> which is FileData.FileName, right. Else you end up open the > same which depends on the system and file open mode, could
> give you exception
%%%%%% the code here means, no matter canclose or not, no matter cancel or not, it always do
paint
> does CanClose() have some side effects ?
cheers
%%%%% assuming you use FileData.FileName in OpenFile()
> I mean your OpenFile() routine got use the newly got file name
> which is FileData.FileName, right. Else you end up open the > same which depends on the system and file open mode, could
> give you exception
%%%%%% the code here means, no matter canclose or not, no matter cancel or not, it always do
paint
> does CanClose() have some side effects ?
cheers
ASKER
Thanks for answering so fast!
I'm not clear on what you're suggesting I try with the line where the program is crashing. You said:
%%%%% assuming you use FileData.FileName in OpenFile()
%%%%%% the code here means, no matter canclose or not, no matter cancel or not, it always do paint
Do you want/need me to send the code sections that were added?
Thanks again!
Skywise