I am glad to say that I can now compile a program under Win95. DevCpp 4.9.7.4 does not freeze any more and the CPU usage is normal. As expected, the file monitoring does not work but that's a minor problem barely noticeable and I still have to figure out why it is so.
Now it produces an access violation (address 0x0042DA29) upon starting (after the splash screen but before the tips), opening a file (before displaying the file selection dialog), creating a new application (after selecting the type of the target application) or going ot full screen mode (after the window is enlarged) but it does not prevent the operation from being performed.
Does anyone else have that problem or is it still a Win95 issue ?
Frederic
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It took me some time to find such a small bug, but I have found why the file monitoring thread does not work under Win95 (too late for v4.9.7.4 :-( ). As I suspected, it is a problem with the function FindFirstChangeNotification that fails if the directory name to monitor ends with a backslash. The problem is that the function ExtractFilePath used to extract the path to monitor does return the last backslash as part of the path. The solution is to remove it if it is present.
Since I don't have the Delphi help file, I could not write a copy-and-paste patch in Delphi but here is the sample program I wrote in C++ Builder. The file to change is Vcl/devMonitorThread.pas
void TdevMonitorThread::BuildDirs(void)
{
int I,Length;
AnsiString Path;
...
fDirs->Clear();
for (I=0 ; I<fFiles->Count ; I++)
{
Path=ExtractFilePath(fFiles->Strings[I]);
Length=Path.Length();
if (Path[Length]=='\\') Path.SetLength(Length-1);
fDirs->Add(Path);
}
}
I guess the C++ "AnsiString" is equivalent to the Delphi "string" but any equivalent code should do.
Frederic
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am glad to say that I can now compile a program under Win95. DevCpp 4.9.7.4 does not freeze any more and the CPU usage is normal. As expected, the file monitoring does not work but that's a minor problem barely noticeable and I still have to figure out why it is so.
Now it produces an access violation (address 0x0042DA29) upon starting (after the splash screen but before the tips), opening a file (before displaying the file selection dialog), creating a new application (after selecting the type of the target application) or going ot full screen mode (after the window is enlarged) but it does not prevent the operation from being performed.
Does anyone else have that problem or is it still a Win95 issue ?
Frederic
Hello again,
It took me some time to find such a small bug, but I have found why the file monitoring thread does not work under Win95 (too late for v4.9.7.4 :-( ). As I suspected, it is a problem with the function FindFirstChangeNotification that fails if the directory name to monitor ends with a backslash. The problem is that the function ExtractFilePath used to extract the path to monitor does return the last backslash as part of the path. The solution is to remove it if it is present.
Since I don't have the Delphi help file, I could not write a copy-and-paste patch in Delphi but here is the sample program I wrote in C++ Builder. The file to change is Vcl/devMonitorThread.pas
void TdevMonitorThread::BuildDirs(void)
{
int I,Length;
AnsiString Path;
...
fDirs->Clear();
for (I=0 ; I<fFiles->Count ; I++)
{
Path=ExtractFilePath(fFiles->Strings[I]);
Length=Path.Length();
if (Path[Length]=='\\') Path.SetLength(Length-1);
fDirs->Add(Path);
}
}
I guess the C++ "AnsiString" is equivalent to the Delphi "string" but any equivalent code should do.
Frederic