This error is typical not only for 7, but also for subsequent
Windows 64-bit.
Delphi 2007 and
2009 are susceptible to the
"Assertion failure" error.
If one run
Delphi 2007 or
Delphi 2009 on
Windows 64bit and met the
Assertion failure when hit
F2 or exit out of the program, this strange error dialog occurs:
bds.exe - bordbk105N.dll
Assertion failure: "(!"SetThreadContext failed")" in ..\win32src\thread32.cpp at line ...
Continue execution?
If Press
No or
ESC key will close the whole
IDE. Pressing
Yes may prompt for the same dialog.
There was an unofficial hotfix at
CodeCentral -
ID: 27521, RAD Studio 2007 Debugger Fix for Windows 7 that now is unavailable.
Further is a temporary solution for this problem.
Using any hex editor, for example,
mh-nexus, an open source version.
1. Close Delphi
2. Make a backup of the library
bordbk105N.dll (version should be 105.11.1.12533) for
Delphi 2007,
bordbk120N.dll (version should be 120.903.17.15115) for
Delphi 2009
For
Delphi 2007 the location is "%ProgramFiles(x86)%\CodeGear\RAD Studio\5.0\bin\bordbk105N.dll",
for
Delphi 2009 the location is "%ProgramFiles(x86)%\CodeGear\RAD Studio\6.0\bin\bordbk120N.dll"
3. Open the library file in hex editor
4. Look for hex string in the file
01 00 48
74 47 80 3d
There is only one(!) HEX
01 00 48 74 47 80 3D
5. Change it to
01 00 48
EB 47 80 3d
74 is replaced with
EB
6. Save
7. Restart
Delphi and the error message should be gone.
That’s all. Now the debugger runs on Windows 64bit.
Or try to find the in the internet the ready-to-use patcher
Delphi_2007_2009_WOW64_Debugger_Fix.zip (Delphi_2007_2009_WOW64_Debugger_Fix.exe) who will do the same for you.
My first note was
«SetThreadContext failed» Delphi 2007/2009 Windows x64.
Here I made more detailed explanation.
An put a concise version of the article on
Stackoverflow