Jump to content

PeterBelow

Members
  • Content Count

    454
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by PeterBelow

  1. PeterBelow

    Disconnected Session

    What target platform is the program you try to debug for? This looks like a problem of debugging via paserver running on another machine over an unstable network connection...
  2. PeterBelow

    Syndey and Athens in same PC

    You can install major versions in parallel but there is one known problem with D11 and D12 if you use certain IDE add-ins (Parnassus bookmarks and one other) due to a naming conflict in some DLLs they use. See here.
  3. PeterBelow

    finding the share of a unc path

    See TPath, it has divers and sundry methods to dissect pathes, including UNC pathes.
  4. PeterBelow

    Delphi 12 IDE, auto-formatter mutilates generics

    Write properly formatted code in the first place? (gdr)
  5. PeterBelow

    Encryption (AES)

    Depends on what you consider "safe". Most stuff on GetIt comes with full source code, so you compile it yourself and for stuff like encryption you do not need any design-time packages, just the code units. I have used (ex) TurboPower Lockbox for encryption in the past; the most recent version can be found on Github.
  6. Packages are an all or nothing thing. In your case the TIdentRec type used by host and package are not the same type, despite of the same name. The package and the host app each contain their own copy of the TestApi unit. To make this work you have to place this unit into its own run-time package, which is then named in the package list of the application and the requires clause of the dynamically loaded package. This way both use the same "instance" of the unit. If you load packages dynamically it is also more reliable to not unload them explicitely but leave that to the RTL package management when the application closes. This avoids some arcane problems with premature unit finalizations. In your case unloading the package seems to mess up the memory manager.
  7. PeterBelow

    Are BPLs and/or DCPs Build specific?

    Yes, you have to make sure the dcus for debug and release are deposited in different folders and modify the debug dcus path in your project accordingly. I have no experience in building projects using run-time packages, but I suspect that you will have to build release and debug packages with different names to avoid conflicts. In fact I would recommend debugging without building with packages, if feasable. Makes life much easier...
  8. Well, I tried your example in D12 ( Win32 target) and the evaluator rejected the expression outright: Edit: Tried same project in D11.3, same result. I suggest you delete the dproj file carried over from D10 and open the dpr in D11.3 to recreate the dproj.
  9. Actually I would not expect that. The breakpoint is placed before the call statement to the IndexText funtion (check the assembly view) so the value of idx is unknown at that point; you have to step over the call to the function to make the result available. If it worked in D10 I would consider it a bug there unless you have tooltip expression evaluation active, in which case the debugger may execute the call to get the result for the tooltip.
  10. PeterBelow

    FirebirdSQL NaN value for numeric field

    TField.IsNull is the way to check if a database field is NULL. Do not rely on this conditions beeing mapped to a specific value.
  11. PeterBelow

    Bringing the IDE automatically to the foreground?

    Since several Windows versions an application running in background (= not having the input focus) cannot simply push itself into the foreground anymore because it thinks itself soo much more important than what the user may currently be working with. Instead it flashes its taskbar button to inform the user that it requires its attention. Does that not happen in your scenario?
  12. The code shown is too incomplete to make sense, but in general a generic class is just a blueprint, it has no actual class representation and thus no RTTI in itself. You have to work with a specific derived type to get RTTI. That unfortunately makes it hard to impossible to do some things in the generic class itself.
  13. It is never a good idea to block message processing in the main thread when a complex control is doing something that may depend on certain messages. The browser has an OnNavigateComplete event, use that to detect when the browser has hopefully reached a "save" state. When stopping the navigation, do not destroy the help form, hide it and only destroy it after the OnNavigationComplete event has fired. In fact I would not destroy it at all since it may get reused again. Anyway, your UI design is rather user-unfriendly in my opinion. I would not like it at all if I cannot read all of the help text just because the mouse pointer moved off the trigger control by accident. And if you only want to show a small help text explaining what the button is for a complex heavy weight browser is certainly not the most effective (and fastest!) way to do that. VCL controls have the Hint property for this purpose, and if you need decorated text (e.g. simple HTML) there are replacements for the THintwindow class used by default that can display text with formatting, like HTML, RTF, or probably also markdown.
  14. As has been said in other replies much depends on the specifics of the case at hand. But the first alternative has one big advantage when debugging: you can set a breakpoint on the line with the assignment and directly inspect the value of Foo there.
  15. PeterBelow

    C++ / windows.h and data alignment

    In Delphi an alignment directive only affects the unit it is in, from the location of the directive to the end of the unit. If I understand the workings of C/C++ compilers re headers correctly (which I may not) a directive in a header also affects all other headers included after the one with the directive, so enforcing alignment in a frequently used header may have unintended effects in customer projects.
  16. Isn't there a comment in the unit that names the type library the unit was created from? A in-process COM server is implemented in a DLL, but that DLL is not explicitely imported by the application using the COM server, so you will not find it listed in the EXE's import section. Since the error message states that the server is not found the DLL may actually not be present on your development machine. Do you have access to a PC where the program you are working on is still running? You should be able to find the DLL there.
  17. There is no point to all of this effort in my opinion, just use methods of the TEncoding "class" directly. If you insist on writing your own wrappers do not declare your own enumeration for the encodings, just let your methods take a parameter of type TEncoding, to which you can then pass TEncoding.UTF8 or one of the other predefined encodings TEncoding offers.
  18. PeterBelow

    Searching Edit component with autocomplete for Directory/Files

    Does a TCombobox, with the Items list filled with the available files, not fit your need?
  19. PeterBelow

    Minimizing Forms

    In all newer Delphi versions ( I think this was implemented after Delphi 7) all forms use the Application.Mainform (the first form created in the application's autocreate list) as the window owner on the API level. If that owner window is minimized Windows automatically hides all the owned forms and it also makes sure the owned forms always are displayed above the owner form in the Z order. You can change this behaviour for your secondary forms by overriding the CreateParams method. procedure TFormX.CreateParams( Var params: TCreateParams ); begin inherited CreateParams( params ); // The following disconnects the form from the main form in Z order params.WndParent := GetDesktopwindow; // The following gives the form its own taskbar button params.ExStyle := params.ExStyle or WS_EX_APPWINDOW; end; The side effect is that the main form can now display on top of the secondary form and hide it. For popup forms that can be a problem. This modification also effectively disables the PopupParent of a form, since that is used in the inherited CreateParams to set the WndParent.
  20. PeterBelow

    List of open delphi IDE

    Is this project of your's a IDE add-on (wizard or such)? If it is implemented in a design-time package you can use the Open Tools API to open a file instead of leaving the task to Explorer.
  21. PeterBelow

    List of open delphi IDE

    If you double-click on a file in Windows Explorer that is the active application, so if you have more than one Delphi instance running none of them is active and which one is handed the file probably depends on which one the BDSLauncher app registered as "server" for .pas files finds first. You have no control over that, so do not open the file by double-click, drag it to the IDE instance you want to use to open it.
  22. PeterBelow

    Issue with CTRL-A

    Looks like the Finalbuilder version uses a different manifest or an ancient style falling back to an old version of the common dialogs DLL. I have no idea how that could influence Ctrl-A behaviour in edit controls, though; that is handled by the native Windows control, unless you have an action or such that traps the key...
  23. PeterBelow

    ExcelApp.WorkBooks.Open() memory leak

    Your code snippet is too incomplete to say for sure but are you ever freeing the SrcWorkbook and ExcelWorkSheet instances you get there? I don't remember whether these are interface types or class wrappers, you have to check the source of the Excel2010 to see what they are. If the two variables are defined in a local scope and are interface types they would be released automatically but not if they are objects...
  24. PeterBelow

    Error on read-only transaction

    Have you tried to explicitly commit or rollback the first transaction before you free the object?
  25. Setting the stream.size to 0 usually is the equivalent of Clear but that depends on the implementation of the actual TStream descendent you are using. Btw.: TeamB was a group of users offering support to other users on the old Borland newsgroups. As recognition they received goodies like free product licences, a bit like the current Embarcadero MVP program, and we had dedicated support partners at Borland. All that slowly died off after Codegear took over, unfortunately.
×