Compiled Delphi resource can not be read on some Chinese Windows - windows

I have compiled a resource in a dll file in two steps
brcc32 Xresource.rc
dcc32 resource.dpr
resource.dpr is a delphi project containing
library resource;
{$R XResource.res}
begin
end.
The problem appears on some (not all) Chinese Windows (XP & 7). On these machines I can't read the strings from resource.
Any Ideea ? Should I compile it in a different way ?
Thank you.

With modern Unicode-ready versions you just keep strings into DFM.
you can also try using resourcestring keyword.

Related

Trying to use Mac dll (bundle) on Wine

I'm currently trying to achieve (for my internship) to use Mac OS dll which are named Bundle (everthing is named bundle on mac ...) because the string comparison fonction from Wine is not working properly (gérard = gerard for example). It causes problems on databases because of the duplications.
Using a DLL to use the native comparison fonction of the OS would settle this problem. But unfortunately, there aren't a lot of documentations to implement properly a working Bundle DLL.
Until now (with my tutor), we succeeded to create a ".bundle" (which works perfectly fine) and then a ".so" but when using it under Wine, we got this error "Bad EXE Format for %1" which tell us that our dll is not in the right format because Wine need a spec file to use native DLL.
We found documentations to make a spec file on WineHQ website but we can't overcome this phase by just following the instructions here(click sur "next" to have the following steps in the bottom right corner ...).
Has anyone ever succeeded (the only one person I saw do it, did it in 2005 ...) to use mac OS DLL on wine and could help us ?
Any help most appreciated.

Encoding of an EXE program

I haven't found any answer or clarification on this subject in the internet.
I have a very old program (over a decade old) for windows (portable executable exe). It displays data in my language (hebrew) and uses cp1255 encoding (old, today is obsolete due to UTF-8). now, the thing is - it only displays data on specific types of computers, so long I've only been able to run it on:
x32 bit windows 7
My question is whether I can get it to work on x64 bit windows 7 encoding. On the x64, the program actually launches, but it displays a whole lot of question marks and jibrish instead of hebrew. I conclude this is due to the encoding.
Sidenote: The program loads info to display from unidentified files (their extensions are fabricated and I have tried to recover and types but so long not very successful). They too, have data in hebrew using the old CP1255 encoding and also has some machine code in it (opened it with a notepad, weird symbols along with text)
I've come up with 2 possible solutions for now:
Either somehow make the program support UTF-8, translate the exe to UTF-8 (probably requires special programs or reverse engineering)
OR
make my OS support the old encoding (cp1255 / windows-1255)
I haven't been able to execute either of them.
If you have any more solutions to tackle this problem or know how to solve it with one of the possible solutions, I'd be glad!
-yuval.
Edit: By the way - I have the language installed. I am using hebrew as one of the keyboard languages and I surf the web with it.
You may have already gone down this path, but have you given a try to running in compatibility mode on your x64 machine? Right click on the executable or shortcut, open properties, and go to the compatibility tab. There is a troubleshooter there that could help.

Is there any way I can compile .PAS files into .COM files?

I am making a retro text adventure game in Turbo Pascal that will be played in MS-DOS, and I want it to be in the COM file format. I've looked it up and have found nothing on this subject. If you can help me that would be greatly appreciated.
Something other than that, whenever I try to run my program (compiled into EXE) from DosBox it can't run due to "This program cannot be run in DOS mode". Is this because I'm using Turbo Pascal 7 and need to downgrade? Thanks a lot of you can figure this out.
Set your TP7 to target dos, not windows. Note that you might have an Windows only TP product (also known as TPW)
COM files will still be out of your reach, but at least DOS exe files should run in dosbox. Keep in mind that COM files have a 64k limitation, and therefore are of limited interest.
Free Pascal is working on a DOS16-bit Dos compiler that can generate com files directly from (64-bit) Windows, and while it is working, it is not released yet.

can I compile a delphi xe2 with VBS code as a resource or dll

I have a few things like running SFC, defrag, and reset the page file and so on, things that can be done within windows VBScript, I am just wondering if I can compile that code as a resource and call it as needed. Thanks.
Lee
You can use the Windows Script Host interfaces, IActiveScript and IActiveScriptParse, to execute Javascript/VBScript from memory. You can then compile your Javascript/VBScript into a resource, extract it at runtime, and then execute it when needed.
Update: have a look at this blog article:
Adding Active Scripting to your
Delphi Win32 application
And then look at this discussion to make it work in 64bit:
Writing a scripting host in Delphi XE2 64-bit

Identifying file type in Windows

Linux operating system identifies files by looking at its magic number at the starting of the header. How does windows do it ? Does it also have some kind of magic number mechanism or does it only rely on the file extension ?
It relies only on the extension, as provided by the filesystem; the contents of the file are not examined. See e.g. this article - it talks about Windows XP, but AFAIK the general behavior is shared by all released versions of Windows so far: http://support.microsoft.com/kb/307859

Resources