Jump to content

uligerhardt

Members
  • Content Count

    94
  • Joined

  • Last visited

Everything posted by uligerhardt

  1. uligerhardt

    Unit dependency viwer

    I have the error when clicking on the folder icon without clicking Create. But I'll just try the new version. 🙂
  2. uligerhardt

    Unit dependency viwer

    Hi! I just downloaded and unpacked the RAR. When I start graph.exe and click on the Project icon I immediately get this: Any idea how to fix this?
  3. Never used TTitlebar but this sounds like there are related units left in the uses clause after removing the component. So maybe the problem hides in some initialization section?
  4. uligerhardt

    Migrate an old app in Delphi 2009 to modren C++

    Do you know Delphi and/or C++? How big is the app? The first thing that should come to mind before considering a rewrite is "Never change a running system".
  5. If you're prepared to write a wizard you might find something in this fragments from a very old wizard I no longer use: procedure TMyWizMainForm.ShowInMessageView(const FileName, MessageStr: string; LineNumber, ColumnNumber: Integer); var MessageServices: IOTAMessageServices40; begin MessageServices := BorlandIDEServices as IOTAMessageServices40; MessageServices.ClearCompilerMessages; MessageServices.ClearToolMessages; MessageServices.AddToolMessage(FileName, MessageStr, '.....', LineNumber, ColumnNumber); ShowMessageView; end; procedure TMyWizMainForm.ShowUnitSource(const FileName: string); begin (BorlandIDEServices as IOTAActionServices).OpenFile(FileName); end; procedure TMyWizMainForm.ShowParseError(e: EParseError); var EditorServices: IOTAEditorServices; TopView: IOTAEditView; EditActions: IOTAEditActions; begin ShowInMessageView(CurrUnit, e.Message, e.LineNo, e.ColumnNo); EditorServices := BorlandIDEServices as IOTAEditorServices; TopView := EditorServices.TopView; if TopView = nil then begin ShowUnitSource(CurrUnit); TopView := EditorServices.TopView; end; if TopView <> nil then begin EditActions := TopView as IOTAEditActions; EditActions.NextError; end; Close; Beep; end; It works (worked?) by inserting a custom line into the IDE's message window and make the IDE jump there.
  6. You can use ShellExecute(0, 'open', PChar(FileName), nil, nil, SW_SHOWNORMAL); to show the unit in your registered Pascal editor - which probably is Delphi. I don't know about the line number.
  7. uligerhardt

    while TStream_TryRead() do

    I think a repeat is conceptually the right thing here, as you want to read at least once unconditionally. And of course written like David did. 😉
  8. uligerhardt

    while TStream_TryRead() do

    Wouldn't a repeat-until loop do the trick?
  9. uligerhardt

    Lib for Getting process name that has the file open

    FWIW: There's also IFileIsInUse. E.g. delphi - Checking if the file is in use and by which application? - Stack Overflow. But it only works for apps that support it.
  10. uligerhardt

    Is there a Delphi equivalent of WriteStr ?

    That's the core of Uwe's code I linked to.
  11. uligerhardt

    Is there a Delphi equivalent of WriteStr ?

    Maybe something like this: Delphi-PRAXiS - Einzelnen Beitrag anzeigen - TextFile Writeln für Klasse verfügbar machen. (delphipraxis.net)
  12. uligerhardt

    Is there a Delphi equivalent of WriteStr ?

    That should be just Str.
  13. uligerhardt

    How to detect if a Dialog is open/running?

    Depending on your needs a non-modal solution might be better - something like Windows' toast notifications. I use DevExpress' dxAlertWindow for that.
  14. I have disabled the "Always break line between else and if" option, and I'm happy with the results. However my colleague insists on having nested if-elses without begin/end pairs and on top mixes this with comments. A simplified example: procedure MyProcedure(a, b: Boolean); begin if a then if b then Beep else Beep else // Kommentar if b then Beep else Beep; end; This gets formatted to procedure MyProcedure(a, b: Boolean); begin if a then if b then Beep else Beep else {// Kommentar} if b then Beep else Beep; end; Is there an option to keep the lines separate under these circumstances? Do you deem the current behavior desirable?
  15. I think leaving the spaces as is (C3) may be the least annoying solution.
  16. uligerhardt

    "Always break line between else and if" vs. comments

    Do I remember correctly that the standalone formatter doesn't use the expert DLL anymore? That should make debugging much easier.
  17. uligerhardt

    "Always break line between else and if" vs. comments

    OK then, I'll see if I can give it a try.
  18. uligerhardt

    "Always break line between else and if" vs. comments

    I'd just use begin/end here too, but that's difficult because of my charcter counting colleague. 😉
  19. uligerhardt

    Add text to existing metafile

    I have an existing enhanced TMetafile in memory (technically speaking an array of them - it's a print preview) and want to add some text to it (page numbers). How can I best achieve that? First I tried creating a TMetafileCanvas for the MF and added my text. But creating the TMetafileCanvas clears the existing MF, so no luck. Could I supress the clearing somehow? The next idea was to clone the original MF: OrigMF := // my metafile in memory CloneMF := TMetafile.Create; try CloneMF.Assign(OrigMF); MFCanvas := TMetafileCanvas.Create(CloneMF, 0); try MFCanvas.Draw(0, 0, OrigMF); // Draw my stuff on MFCanvas finally MFCanvas.Free; end; OrigMF.Assign(CloneMF); finally CloneMF.Free; end; but I didn't manage to preserve the page dimensions, font sizes etc. The reference DC used to create OrigMF is gone and the combinations of properties like Width, MMWidth and Inch that I tried didn't help. How could I clone OrigMF retaining these informations (that must be stored inside)? PS: While writing this post I managed to dig out a reference DC that worked. But answers would be still interesting.
  20. uligerhardt

    Add text to existing metafile

    Thanks, I didn't see that comment. And indeed it mostly works without the cloning. However without passing a reference DC <> 0 resolution/size still get mixed up. But as mentioned in my postscriptum I found a compatible DC, so that's only a cosmetic problem. :-))
  21. The Alt-F7/8 shortcuts for moving through compiler messages don't work for me anymore (since some time already). I suspect these GExperts shortcuts to be the culprits: Can anybody confirm the issue?
  22. uligerhardt

    Grep Alt-F7/8 disable builtin shortcuts for message window

    I had a look in the source code and decided I don't want to mess up GExperts' shortcut management. 😅 However I discovered that the relevant actions (actListSelectNext/actListSelectPrevious in TfmGrepResults) have SecondaryShortCuts assigned. These don't work for me out of the box but I assigned them in the config dialog: I'll check how that works out for me.
  23. uligerhardt

    Grep Alt-F7/8 disable builtin shortcuts for message window

    I guess one could track the most recently focused one of the "target" lists. Maybe it could work to have the shortcuts enabled (i.e. <> 0) only if the Grep result list is focused? I'll see if I can play a bit with that.
  24. uligerhardt

    Grep Alt-F7/8 disable builtin shortcuts for message window

    I just compiled a new GExpertsRSXE6.dll and the problem persists: Alt-F7/F8 iterate through the Grep results but not the compiler messages. Does anybody else have this issue? How can I fix it? I would like the shortcuts to work in both lists (e.g. depending on the focus) but if this isn't feasible I'd like to work them for the compiler messages.
  25. uligerhardt

    Scrap TVirtualStringTree using Win 32 api (SendMessage)

    TVirtualStringTree is a custom control completely written in Delphi/VCL, so WinAPI messages won't help (especially not ones meant for list views). Are you extending the Delphi app? Do you have its source code? Do you want to talk to a running instance of the app?
×