Delphi XE2 application fails to run in Windows (Chinese Language Pack) - delphi

I have a Delphi program which runs on Microsoft Windows (English) environment, but fails when running in a Windows (Chinese) environment.
The error message is:
Exception EReadError in module rtl160.bpl.
Error reading Button2.Click Invalid property Value
However, the "Button2" has a valid OnClick event method.
I have several other similar Delphi programs which run in both environments. I haven't spotted what is different about this particular program.
Anyone else run into this sort of thing? Where are the best areas to look?

Related

running delphi application on non delphi pc

I'm building an application using delphi 7 with ms access 2007 as the database for a client. it runs normally on my laptop (asus) but after I copy the whole project folder and run the Project.exe, it gives me an error "Disk write error".
I've tried googling about "disk write error delphi application" but only found about I/O errors. my application only opens a file after a button click in a form that is called when I click on a submenu, so I'm guessing it's not about I/O..
what is the solution?
thanks in advance
P.S.:
in the project options, the checkbox for building application using runtime packages is already unchecked.
my PC and my client's PC are both using windows 7 32bit (I haven't actually confirmed this with him but I'm guessing he's also using 32bit version because he's not a techy guy)
his PC doesn't have delphi installed
UPDATE :
I forgot that the exact error message was "Disk or network error" instead of "Disk write error".
after googling for the correct error message, I've found out that the problem is that I use a full path for the DataSource in the ADOs' connection string. after I change connection string into "DataSource=.\db\my_db.mdb", the application works perfectly.
even though this question has a negative mark, I'll just leave this solution here in case someone needs it in the future...
Here are some different questions.
The "Disk write error" probably is that you need permissions to write in the folder. A simple test is that you execute your application with "admin permissions" to test this.
Different question is the "using runtime packages" check in project options.
If you compile your application with this check, you need to copy the BPL's needed for your application with the executable.
If you compile with this option unchecked, your exe file include all the libraries for execute (not included DLL's or external dependencies).

Is there any key differences between Delphi 2010's compiler and Delphi XE that could cause an EOS Error Code: 1158

As the question suggests I have an app that I can run perfectly fine after building under Delphi 2010, however if its compiled under Delphi XE I get the error:
Project xyz.exe raised exception class EOSError with message 'System Error. Code 1158. The current process has used all of its system allowance of handles for Window Manager objects'.
The error occurs after receiving a large amount of data from an SQL query but it seems odd that it only crashes out after being built with XE. I've run FastMM in the 2010 environment with no issues unfortunately I cant run it in XE as I only have a compiler license which is running on a build server.
I've also checked the number of handles being used through PERFMON and the 2010 version uses more handles that the XE version with no problem.
Any ideas?

Delphi 6 Exe on Vista: Problems with GetWindowText

I have an exe file compiled with Delphi 6 under Windows XP that uses a combination of EnumWindows and GetWindowText to find a window (not belonging to the exe itself) with a specific title.
The behaviour is as expected under Windows XP. On Vista computers however, it doesn't seem to work.
As the mentioned Delphi version doesn't run on Vista, I cannot change and test this directly.
However, I will try to create a modified exe on the XP computer that outputs some additional data and copy it to the Vista computer.
I would just like to ask whether anybody has any information whether there are specific problems known with exe files compiled with Delphi 6 running on Vista regarding EnumWindows/GetWindowText.
The exe uses EnumWindows and GetWindowText to find the handle of a certain window in order to then parse the title of that window in a timer event. The window title is the application name plus the name of the file opened in that application (if any file is opened). The Delphi exe analyses/uses this file name, does something with it and behaves in a certain way.
On Vista the expected behaviour does not appear, thus I presume that the window handle is not found cause GetWindowText does somehow not return the text. Another reason of course could be that EnumWindows does not work properly and the window handle of the window that the exe is looking for is never send to the EnumWindowsProc.
Assuming that there has been no change in window title from XP to Vista, there's not much that can go wrong here. I'd hazard a guess that the problem is due to UIPI. This is part of the security enhancements of Vista and it means that processes can only send messages to other processes that have equal or lower integrity level. Is this other process running elevated?
Other than that your best bet is to run this under the debugger. Delphi 6 most certainly does run on Vista. It was written before UAC and so doesn't get on well with having no rights to write to its install directory. So, install it to somewhere in your user profile or C:\Delphi6 – basically anywhere that standard users have write access.
Finally, don't fall into the trap of running Delphi elevated. This will confound the UIPI issue if indeed that is an issue here.
Good luck!

When is System.IsConsole true in Delphi?

According to System.pas, it is documented as True if compiled as console app. In System.pas, there is also an assignment
{$IFDEF LINUX}
IsConsole := True;
...
I have a strange problem where an app is launched from a Delphi app, using ShellExecute, and then it runs into this code, raising the (unexpected) exception
if System.IsConsole then
raise Exception.Create(Msg)
The application is not compiled with Project/Options/Linking/Generate console application. What else could set IsConsole to true?
Note that in Delphi XE2, OSX applications can not use this variable as it is always true. See QC Entry 98956 and Why Does My OSX FireMonkey App Think It Is a Console App ?
Found it: the executable has been created using dcc32.exe and the dpr / cfg file, the cfg contains a line
-cc
which creates a console application.
The Delphi 2009 Enterprise IDE does not show this setting in the Project/Options/Linking/Generate console application dialog. The application was ported from an older Delphi version and maybe something went wrong over the years.

Problems with Bitbtn in Delphi 6 under Windows vista

I've been working for a long time under Windows XP with Delphi 6 (and under Win2k before).
As I've recently bought a new laptop, I had to start using Windows Vista.
I've installed Delphi 6. Whenever I used the TBitBtn component, I get error when running the compiled program: like resource BBOK not found, resource BBcancel not found, etc.
"Project Project1.exe raised exception class EReadError with message 'Error reading BitBtn1.Kind: Resource BBCANCEL not found'. Process stopped. Use Step or Run to continue."
Right now, I do not have possibility to try to run the exe-file on WinXP; however I was able to compile the same code under WinXP and the produced executable ran fine under Windows Vista as well.
Is there some simple workaround other than upgrade to a newer version of Delphi?
Thanks in advance!
This is definitely not a very neat solution, but this issue seems working after:
Copying Buttons.pas and buttons.res from Sources\Vcl to the directory with my project.
Editing Buttons.pas to use QBOK, QBCANCEL etc. instead of BBOK, BBCANCEL.
Thanks for your comments.

Resources