Jump to content

A.M. Hoornweg

Members
  • Content Count

    446
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by A.M. Hoornweg

  1. A.M. Hoornweg

    Rio and MDI Applications

    The whole thing with MDI is that it is not only suitable to offer a user multiple documents at the same time, but also multiple views at the same time. I haven't seen a good GUI alternative for that. Anything with tabs, bars, pagecontrols etc basically serves to only hide views from sight which is quite the opposite of what I need.
  2. A.M. Hoornweg

    Rio and MDI Applications

    I've never noticed. All my mdi client forms have either a panel or a tscrollbox in the background.
  3. A.M. Hoornweg

    Rio and MDI Applications

    MDI itself works fine on Windows 10 for me.
  4. A.M. Hoornweg

    Boolean evaluation

    In the Windows API, sure.
  5. But a program (such as an editor) needs to know if the file is UTF8 in the first place. Without a BOM, it must guess.
  6. A.M. Hoornweg

    Boolean evaluation

    Not only that, but the code "if Somebool=True" has a little known pitfall. Every Delphi program interfaces with libraries written in C or C++ (such as the Windows API, all sorts of drivers etc) and in the C language, a bool is basically an INT. I have had a few cases where a function was supposed to return a boolean and in reality it returned some integer where 0 signalled FALSE. The code (if Somebool Then...) treats 0 as false and all other values as TRUE. That always works as intended. The code "If Somebool=True THEN ..." only treats 1 as TRUE and everything else as FALSE. CASE statements are affected, too. So the following code fails: var SomeBool:boolean; begin SomeBool:=Boolean(2); //Simulate a DLL returning a "wonky" boolean if (SomeBool=True) then ShowMessage('True'); CASE SomeBool of True: ShowMessage('True'); False:ShowMessage('False'); END; If Somebool then ShowMessage('Still it is true...'); end;
  7. 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?
  8. A.M. Hoornweg

    'stdcall' for 32-bit vs. 64-bit?

    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';
  9. A.M. Hoornweg

    Set a PC environment based on a Country name..

    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.
  10. A.M. Hoornweg

    HxD hex, disk and memory editor

    I've been using HxD for at least 5 years, highly recommended.
  11. Could you give us a short explanation how to compile a UTF8 RC file containing unicode strings ?
  12. 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.
  13. 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.
  14. A.M. Hoornweg

    VERY SMALL IDE font sizes

    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.
  15. A.M. Hoornweg

    VERY SMALL IDE font sizes

    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.
  16. 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?
  17. A.M. Hoornweg

    Install recent Delphi versions on Windows XP

    @alberto do you mean the Delphi IDE, or just apps compiled with 10.3.3 ?
  18. A.M. Hoornweg

    Anything sensible for source code documentation?

    @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.
  19. A.M. Hoornweg

    Anything sensible for source code documentation?

    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.
  20. A.M. Hoornweg

    Windows 10 vs Windows 7 debugging

    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".
  21. 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?
  22. A.M. Hoornweg

    Thinfinity VirtualUI - cloud-based conversion

    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.
  23. A.M. Hoornweg

    Thinfinity VirtualUI - cloud-based conversion

    An OCX *is* a DLL.
  24. A.M. Hoornweg

    Why can't I install this monospaced font in Delphi ?

    Currently "Consolas" and "Source Code Pro" are my favorites.
  25. 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.
×