Jump to content

PeterBelow

Members
  • Content Count

    528
  • Joined

  • Last visited

  • Days Won

    13

Everything posted by PeterBelow

  1. PeterBelow

    How can to set up an umbrella unit?

    I assume Forms.Dialogs.pas is a unit not defining a form build in the form designer? In this case I would export functions from that unit that internally create and show(modal) one of the specific form classes, setting any needed setup values from parameters passed to said functions and returning any data entered/selected by the user as function result or in var or out parameters. This way other units need not require the specific form class units in their uses clause, only Forms.Dialogs. Note that the dialog forms would not be autocreated in this setup, the exported functions would all create, show, and then free a new instance of their dialog form.
  2. The VCL has to work in the API environment that Windows provides. So aim your criticism at Microsoft ;).
  3. You are wrong, the design makes eminent sense for a message/event driven environment like Windows. A modal form has its own internal message loop and that needs a way to figure out that it should exit the loop. Modalresult <> mrNone is that condition.
  4. PeterBelow

    Current Generation methods in Apps under Windows 7?

    The IDE requires Win10 or 11, but applications build with it can run on older Windows versions, depending on which features they use. It may be necessary to modify the default manifest, though, if it specifies a newer Windows version as requirement (have not checked if it does).
  5. Yes, my bad. I'm getting old ... 🙂
  6. in a dynamic 2D array ( a type like TMyArray = array of array of integer) you can set the number of rows with a SetLength call on the array variable and, for each row, set the number of columns with a SetLength(arrayvar, rowindex) call. That should cover your requirements. To reduce memory fragmentation you should avoid multiple SetLength calls on the same array row or the array itself, though. Determine the number of rows/elements beforehand, if possible.
  7. PeterBelow

    Catch WM_DROPFILES in TRichEdit

    Well, it has to be something you do in your code then. I just created a new VCL app (D12.2), dropped a TRichedit on it, build and ran and it inserts an image (jpg in this case) dragged from Explorer to it just fine. If you now handle WM_DROPFILES or such try to disable that.
  8. PeterBelow

    Catch WM_DROPFILES in TRichEdit

    XE6 and D12 use different versions of the Windows richedit control as far as I remember, that may explain the change in behaviour you see.
  9. Looks like the GetAdminSection function does not return an automation-compatible interface. Can you check what VarType the returned OleVariant has?
  10. Try Result := not (VarIsClear(OleObject) or VarIsEmpty(OleObject) or VarIsNull(OleObject)) and (VarType(OleObject) = VT_DISPATCH);
  11. PeterBelow

    Help needed with WSDL import

    If you open the wsdl in a browser you will see that it is very complex, importing a lot of xml schemas which partially import other schemas, using a host of namespaces. And the schemas seem to be not valid in some cases, e.g. by using namespace prefixes like tns: without defining them. The wsdls also refer to a script but fails to define a namespace for it, no idea if that is valid.
  12. PeterBelow

    Make Bold DBRrid Row Color

    Look at this help entry for an overview of how to modify the way a TDBGrid is drawn. In your case set the DefaultDrawing property of the grid to false and attach a handler to the OnDrawColumnCell event. The handler can check the attached dataset's current row to see what row it has to draw. If it is the first just call the grid's DefaultDrawColumnCell method directly. If it is the second row change the grid.canvas.font to bold first and then call DefaultDrawColumnCell. That should do what you want.
  13. PeterBelow

    Should I just dive in to GUI programs?

    GUIs are just the majority of the applications build with Delphi. But you can easily build console programs with it, too. The File -> New dialog also offers a template for that.
  14. PeterBelow

    Component property disappears from DFM

    In this case just override the Loaded method of the frame and link the event handler in code there, after calling the inherited method first. That will fix the issue even if you cannot figure out why it happens in the first place. Not really satisfactory, of course, but the only reason I can think of would be if somebody cleared the Name property of the dataset in question or moved the handler method from published to public scope by accident.
  15. The IDE configuration is stored in the registry and the HKEY_CURRENT_USER hive is of course specific for the user account the IDE is running under. Compare the content of the HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\23.0\Editor\Options\Known Editor Enhancements and HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\23.0\Experts keys under the two accounts (adjust the 23.0 if you use a different Delphi version than 12.2).
  16. If you run into this problem and then call up the Tools -> Options dialog, what does it show as active key mapping on the Editor -> Key mapping page?
  17. PeterBelow

    GetDeviceCaps freezes everything

    If you put a breakpoint on the first GetDeviceCaps line, do you reach it when running under the debugger? If so, does Printer.Handle have a reasonable value? Are you dealing with a network printer here that may be offline? So many questions, so little data...
  18. But you can state it explicitely, just use an appropriate type cast, e.q. Smallint(1) instead of just 1.
  19. PeterBelow

    Enum modules return ONLY the application, no other packages

    Have you enabled "Build with run-time packages" in the project options? If not all code from the units in question will be compiled into a monolithic exe and there will be no other modules other than DLLs used from the OS or statically linked by units used in the application.
  20. PeterBelow

    FindFirst : with network files it fails

    You need file system level authentification to access files on the LAN via file system API functions, see WNetAddConnection3 if this is for Windows. For web folders you have to use something like ftp if the server supports it.
  21. PeterBelow

    Wrap texts in DBGrid

    TDBGrid does not support that. If you have fields with long text a grid is not the best way to show it, better use a TDBMemo in addition to the grid and tie it to the field in question. It will them show the field content of the record active in the grid as the user scrolls through the records.
  22. Look at the System.Hash unit, this kind of problem is usually the domain of hashing.
  23. PeterBelow

    Delphi 12CE and SQLite

    Yes, apart from the licence restriction re yearly revenue.
  24. PeterBelow

    Can I make the form larger in the IDE?

    Take a look at TVirtualImagelist and TVirtualimageCollection, these allow you to supply different versions (sizes) of bitmaps optimized for the DPI settings your app may encounter in the wild. This tends to look better than getting the images scaled at runtime from a single sized version.
  25. PeterBelow

    Delphi 12CE and SQLite

    You do not have the source (pas) for the unit and you should never set up a project to have the source files for Delphi RTL etc. units on its search path. You should have the precompiled FireDAC.Phys.SQLiteWrapper.dcu, though, and the path to its folder should be on the IDE library path for the target platform in question.
×