

A.M. Hoornweg
Members-
Content Count
490 -
Joined
-
Last visited
-
Days Won
9
Everything posted by A.M. Hoornweg
-
Stop IDE from writing unit names all by itself ?
A.M. Hoornweg posted a topic in Delphi IDE and APIs
Hello all, I'm in the process of evaluating if it's feasible to port a very large project from Delphi XE to RIO. Now I'm stumbling upon the situation that the RIO IDE automatically inserts unit names (such as "system.actions") into forms I'm editing. That's a colossal p.i.t.a. since I need to be able to edit and compile these forms in Delphi XE as well. I thought I could simply wrap these new unit names inside an {$ifdef compilerversion...}, but Rio will still append the unit names at the end of the unit list and then complains about the duplicate unit names. How can I prevent that from happening? -
The default calling convention in Delphi is "register" (the compiler tries to pass parameters in registers if possible to speed things up). The "Stdcall" convention is used throughout by the 32-bit Windows API (which consists of DLL's). So, for consistency's sake, it makes sense to adopt that calling convention for your own 32-bit DLL's as well. "Stdcall" tells the compiler that the caller of the function will pass all parameters on the stack in a right-to-left sequence and that the function itself is responsible for cleaning up the stack before returning. As Remy Lebeau pointed out, in 64-bit Windows there's only one calling convention. So you could do something like this: //in the DLL: Procedure MyProc; {$ifdef win32} Stdcall;{$endif} Export; begin .. end; ... exports 'MyProc'; //In the exe: Procedure MyProc; {$ifdef win32} Stdcall;{$endif} external 'mydll.dll';
-
Set a PC environment based on a Country name..
A.M. Hoornweg replied to Ian Branch's topic in General Help
Alternatively, if you already have a lot of code executing SQL statements as strings, just create a new tFormatsettings with the correct formats for date, time and decimalseparator for your database. Many Delphi string routines such as Format(), DateTimeToStr() etcetera have an optional Parameter of type tFormatsettings which will then apply this format. -
I've been using HxD for at least 5 years, highly recommended.
- 31 replies
-
- hex editor
- disk editor
-
(and 3 more)
Tagged with:
-
Skipping the UTF-8 BOM with TMemIniFile in Delphi 2007
A.M. Hoornweg replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Could you give us a short explanation how to compile a UTF8 RC file containing unicode strings ? -
Skipping the UTF-8 BOM with TMemIniFile in Delphi 2007
A.M. Hoornweg replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
I prefer that, too. The matter is just if we should write a BOM or not. In regular Windows INI files it won't work. In tMemIniFile it will. In XML it's optional. In Linux it is frowned upon because everything is supposed to be UTF8. In Windows every text is some flavor of ANSI unless it has a BOM. -
Skipping the UTF-8 BOM with TMemIniFile in Delphi 2007
A.M. Hoornweg replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
That's only safe if your character set is limited to Ascii. Once it contains any character > #127, it is unclear which character it is, because how's the application to know the code page the file is using? My code / annotations contain lots of umlauts and maths symbols. -
It actually makes (some) sense. This latter setting enables Windows to ignore the high-dpi compatibility setting in the program's manifest so you can test out which setting works best for the application. Also, you can specify if the setting is valid for all users or just for you.
-
In the current Windows 10 version, there's a new feature that lets you override the scaling behaviour of individual executables. Right-click the executable in the explorer-> Compatibility -> Change High-DPI settings.
-
Hello all, I am sorely missing a way to document sourcecode alongside the sourcecode. I believe that what I'm looking for doesn't even exist. Or? I find formats like Xmldoc totally obnoxious because it interrupts the source code and the text is never in the place where I need to consult it. My wide screen has plenty of horizontal space alongside the code. So why can't I use that empty space to explain what my code is doing and why I wrote it that way, maybe even with nice text formatting, hyperlinks and images?
-
Install recent Delphi versions on Windows XP
A.M. Hoornweg replied to dummzeuch's topic in Delphi IDE and APIs
@alberto do you mean the Delphi IDE, or just apps compiled with 10.3.3 ? -
Anything sensible for source code documentation?
A.M. Hoornweg replied to A.M. Hoornweg's topic in General Help
@David HeffernanNice to hear we're in related businesess! I had no way of knowing. Okay, so you're doing the documentation in external documents which you cross reference from the source. I'm doing that too, but it's for lack of a better solution, because major changes/reformatting of the docs requires locating where the docs are referenced in the source and updating that, too. It'd be sooo practical to have source and docs synchronized in the IDE somehow. In full-screen mode I have 50% free space between the right gutter of the source code and the project explorer, it would be great to have a documentation tool fit in there that uses anchors/links in the source code. Off topic: I find that the screen real estate of today's monitors is used inefficiently by most IDE's. Ribbons at the top and logs at the bottom all reduce my view of the document I'm editing. Recently I had to debug a large and poorly documented piece of source in Visual Studio so I decided to rotate the screen 90 degrees. That was... kind of overwhelming and very gratifying. If my screens weren't so large I'd keep it that way. -
Anything sensible for source code documentation?
A.M. Hoornweg replied to A.M. Hoornweg's topic in General Help
David, sorry but that's not helpful. This is not some "library" and there is no "consumer". The code I'm talking about is internal and scientific. It does stuff like calculating the 3-d trajectory of curved oil wells, calculates dynamic pressure losses caused by drilling fluid being pumped downhole through a complex drillstring and then up again through the annular space between the drillstring and the wellbore (the flow can behave laminar in some segments, turbulent in others) etc. and tons of other things. There is no way to make such code self-explanatory, it requires knowledge of physics, fluid dynamics, geometry and engineering. So I want to document this code in great detail to explain what's going on inside, with hyperlinks to scientific literature, Wikipedia etc. Because when I retire in ten years, the code must be maintained and enhanced with new fluid dynamic models by my successor and he'd better know what he's doing. Since the comments are going to be as large as the code itself, a side-by side solution would be ideal for me. Using Xmldoc or Javadoc/pasdoc only interrupts the flow of things, making it more difficult to read. -
Is your development machine a VM? Does it have the VMWare tools installed? I find that it makes a *vast* speed difference in a VM when I disable unneccessary graphical goodies in Windows 10. Go to control panel -> System-> Advanced system settings -> Tab "Advanced" -> Button "Performance Settings" -> Tab "Visual Effects" and click radiobutton "Adjust for best performance". Then re-enable only essential stuff like "smooth edges of screen fonts" and "show windows while dragging".
-
Why can't I install this monospaced font in Delphi ?
A.M. Hoornweg posted a topic in Delphi IDE and APIs
Hello all, I would like to test a certain new monospaced font in Delphi but none of my Delphi versions displays it in the font drop-down list. Is there anything I can do to use it anyway? -
Thinfinity VirtualUI - cloud-based conversion
A.M. Hoornweg replied to Mark Williams's topic in General Help
I have just tried some of their live demos. They do not work in my Opera browser but they do work with Edge. So depending on your browser, your mileage may vary. -
Thinfinity VirtualUI - cloud-based conversion
A.M. Hoornweg replied to Mark Williams's topic in General Help
An OCX *is* a DLL. -
Why can't I install this monospaced font in Delphi ?
A.M. Hoornweg replied to A.M. Hoornweg's topic in Delphi IDE and APIs
Currently "Consolas" and "Source Code Pro" are my favorites. -
Hello all, I think I've discovered an anomaly in Delphi string behavior. Consider the following code: procedure TForm1.Test(const Defaultvalue: string; out Resultvalue: string); begin Resultvalue:=AnsiUpperCase(Defaultvalue); ShowMessage(Defaultvalue+'.'+Resultvalue); end; procedure TForm1.Button1Click(Sender: TObject); var s:string; begin s:='default'; Test(s,s); end; The output produces just a dot, which makes no sense to me.
-
Hi Stefan, do you know if that folder is only for domain users? Or are there other scenarios in which that folder is synced between machines?
-
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
Strange, when I first noticed the problem it went away 100% after I replaced string with widestring. But somehow I can't reproduce that anymore. Weird! -
Memory leak in UnicodeString to string conversion
A.M. Hoornweg replied to dkprojektai's topic in OmniThreadLibrary
Library, as in DLL? You really can't pass a "string" from a DLL to an application, except when both projects are configured to use a shared memory manager ("uses sharemem"). -
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
I meant, the allocated memory in a widestring isn't managed by the Delphi heap but by Windows. -
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
There is one thing I don't understand though. In the example below, shouldn't the string which is held by variable S have a reference count of at least 2 when procedure Test is called? One held by S itself, one by Defaultvalue? Normally the compiler should perform a Uniquestring whenever something is written to a string with refcount >1, or? procedure TForm1.Test(Defaultvalue: string; out Resultvalue: string); begin Resultvalue:=AnsiUpperCase(Defaultvalue); ShowMessage(Defaultvalue+'.'+Resultvalue); end; procedure TForm1.Button1Click(Sender: TObject); var s:string; begin s:='default'; Test(s,s); end; -
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
Besides, the problem is not consistent, it only occurs with managed types. For example, it does not occur with WideString.