Jump to content

dummzeuch

Members
  • Content Count

    2854
  • Joined

  • Last visited

  • Days Won

    101

Everything posted by dummzeuch

  1. That you can't extract the certificate does not mean that you cannot write a new one to the token. Otherwise, how would they create those tokens with a certificate?
  2. dummzeuch

    Delphi 12.2 Toolbars strange behavior

    Hm, that just got me thinking: GExperts has this Editor Toolbar which can be freely configured, using any actions registered in the IDE. This works fine, even in Delphi 11 and 12 where the built in toolbars are broken. Since Embarcadero seems unable to fix their bl***y toolbars, a plugin could just insert a panel at some convenient place - maybe just below the main menu? - and make it a toolbar. Any takers?
  3. dummzeuch

    Naming abbreviations for controls

    GExperts has a Rename Component expert which has two different presets for many component types. No idea where the preset "defaults" comes from, the second one is called "twm" and you can probably guess whose initials these are. (The presets are not covered in the help yet.) I think, cnPack also has a similar functionality but I don't know anything about it.
  4. dummzeuch

    Refactor rename field fails always

    But MMX works differently. It does not really analyze the code but replaces all matching strings within a given scope (e.g. a procedure) rather than identifiers. That's why it can optionally even replace identifiers mentioned in comments. But it can also replace strings that are not the intended identifier.
  5. dummzeuch

    Looking for a certain component

    Maybe it's a TStaticText? That one has got Bevel-options.
  6. dummzeuch

    Uses Clause Manager topic added to the GExperts help

    Added the help button.
  7. They say that documentation is the worst part of programming and I mostly agree with that. Nevertheless I have taken the time to add a page about the Uses Clause Manager expert to the GExperts help because that topic was completely missing. I hope I covered all the topics. There is no help button on the form yet. I’ll look into that later. There is also an updated chm file as well as a printable manual in PDF format.
  8. dummzeuch

    Resizing Object Inspector Pane in 12.2p2

    Since it works for me and doesn't work for you, this obviously is not a global issue but somehow related to your setup. Maybe you could start by comparing your setups: number of monitors monitor resolution(s) scaling is the IDE on the primary or secondary monitor Did you try different combinations? I have got: 2 Monitors: 3840x2160 scaled to 125% left of primary monitor (-> x coordinates are negative) top above top of primary monitor (-> y coordinates are positive and negative) 1920x1200 not scaled, primary monitor I don't have this effect, regardless on which monitor I put the IDE. (I have lots of other problems with the IDE though. Monitors with different resolutions and scaling are apparently not used by the Embarcadero developers.)
  9. dummzeuch

    Resizing Object Inspector Pane in 12.2p2

    Are we talking about a docked object inspector Window then? I was assuming undocked because you didn't mention other windows docked at the same place. Hm ... testing ... there is a sensible width constraint, but again, rather narrow. What do you actually mean by "narrow"? How many pixels? And is this a scaled monitor?
  10. dummzeuch

    Resizing Object Inspector Pane in 12.2p2

    I wouldn't dare calling you dumb, but I don't have that problem on my installation. I can narrow the object inspector window so much, it becomes unusable. It's probably a difference in hard- or software or different settings.
  11. dummzeuch

    for loop variable value after the loop

    I just came across this code: var I: Integer; begin for I := 0 to Collection.Count - 1 do if TListColumn(Collection.Items[I]).WidthType <= ColumnTextWidth then Break; Changed(I <> Collection.Count); WriteCols; end; Is it just me or does anybody else think this is wrong? Or is the value of a for loop variable after a loop explicitly defined nowadays? I always thought that's compiler dependent and should not be relied on.
  12. dummzeuch

    for loop variable value after the loop

    A for loop is not a while loop with inc. the compiler might create code that counts down to zero rather than up, if the variable is not used inside the loop. Edit: Or it might even completely unroll the loop doing away with the variable altogether. But it does not matter: Relying on an undocumented implementation detail is a bad idea, regardless of whether it works or not. The next compiler version or a different compiler e.g. for a different platform might change that detail.
  13. dummzeuch

    How do you shut off the Welcome Page?

    You could remove the corresponding package WelcomePageIDEXxx.bpl and its associated plugins from the IDE's list of Known IDE Packages. Somebody 😉 even wrote a tool for this: https://blog.dummzeuch.de/knownidepackagesmanager-tool/
  14. I'm still kind of new to using generics but I try to start using them where previously I would have created a pseudo template. I need to store some objects and access them giving a string key. I thought that a TObjectDictionary<string, TMyClass> would be the solution for this, but it turns out that it does not allow duplicates, but I need that. Later on I want to get the first matching entry and enumerate all of them. What would be the best generic container for allowing duplicates in this case, if there is any? Some kind of sorted object list? (I'm asking for generics that are part of the RTL, please don't point me to any 3rd party implementations.)
  15. dummzeuch

    for loop variable value after the loop

    Delphi 12, unit VCL.ComCtrls, method TListColumn.DoChange, line 17287. Probably also in older Delphi versions, I haven't checked. This didn't cause my actual problem though, because it works, even though it is undocumented behavior. Unfortunately I haven't found the cause, just a workaround, but that's enough for now.
  16. dummzeuch

    for loop variable value after the loop

    OK, so that's a bug in the VCL code then.
  17. dummzeuch

    Switching off automatic Bookmarks?

    You're apparently assuming that I read the help before using MMX. I didn't. I installed it and started to explore what it can do (and watched part of your video on YouTube). Reading the docs (help) is so 1990ies ... Since at the same time I also started to use Delphi 12 in anger I didn't know what caused these bookmarks. It could have been one of the many flaws of that new IDE. Also the bookmarks have become more visible in Delphi 12 than they were n 10.2 so having them turn up all the time became more annoying.
  18. dummzeuch

    Switching off automatic Bookmarks?

    Hm, I just tried that but since I am not using Outlook but Thunderbird it failed to generate the email. But since I am only starting to use MMX, that won't have told you much anyway. btw: I found theses automatically dropped bookmarks annoying, especially since I didn't know what created them. Thanks to Peter's question I know now how to disable them and did.
  19. dummzeuch

    [Open Source] Delphi Youtube Downloader

    So it is a GUI wrapper for yt-dlp.exe?
  20. dummzeuch

    ssh tunnel with ssh-pascal

    No dice either. Still the same error message. Sorry, I am too tired to be of much help here.
  21. I'm trying to get ssh tunneling to work with ssh-pascal. The goal is to replace the currently used ssh tunnel for Remote Desktop via Putty with my own program. I adapted the LocalForward demo and I can connect to and read from http://detectportal.firefox.com/success.txt (the original url http://git.php.net/ is apparently no longer available) Then I changed the code to connect to my employer's internet facing ssh server port and forwarded a local port to the remote 3389 port of a computer in our LAN. I can log on fine to the ssh server, even the Remote Desktop client starts, connects and gets a valid logon. But then it asks whether it should connect even though the certificate is not from a trusted certifying authority (which is normal for that connection) and pressing Yes there odes not do anything and the RDC connection times out after a while. I added some debug WriteLns and found that the processing thread while executing TSshTunnel.ForwardLocalPort is waiting to read from ForwardSock here, after apparently FD_ISSET returned True: SetLength(Buf, FBufferSize); while not FCancelled do begin FD_ZERO(ReadFds); _FD_SET(ForwardSock, ReadFds); _FD_SET(ChannelSock, ReadFds); // wait for action ReturnCode := select(0, @ReadFds, nil, nil, @TimeVal); if ReturnCode < 0 then CheckSocketResult(ReturnCode, 'select'); if ReturnCode = 0 then Continue; // we should be able to read now WriteLn('Checking ForwardSock'); if FD_ISSET(ForwardSock, ReadFds) then begin WriteLn('Reading from ForwardSock'); Read := recv(Forwardsock, Buf[0], FBufferSize, 0); // <=== hangs here if Read = SOCKET_ERROR then CheckSocketResult(WSAGetLastError, 'recv'); if Read = 0 then raise ESshTunnelError.CreateRes(@Err_ConnClosed); WriteLn(Read, ' bytes read from ForwardSock'); Total := 0; While (Total < Read) do begin Written := libssh2_channel_write(Channel, PAnsiChar(Buf) + Total, Read - Total); // Takes care of LIBSSH2_ERROR_EAGAIN CheckLibSsh2Result(Written, FSession, 'libssh2_channel_write'); Inc(Total, Written); Writeln(Written, ' bytes written to ChannelSock'); end; end; WriteLn('Checking ChannelSock'); if FD_ISSET(ChannelSock, ReadFds) then begin WriteLn('Reading from ChannelSock'); Read := libssh2_channel_read(channel, PAnsiChar(Buf), FBufferSize); if Read = LIBSSH2_ERROR_EAGAIN then // Go to Wait state again Continue; CheckLibSsh2Result(Read, FSession, 'libssh2_channel_read'); WriteLn(Read, ' bytes read from ChannelSock'); Total := 0; While (Total < Read) do begin Written := send(forwardsock, Buf[Total], Read - Total, 0); if Written = SOCKET_ERROR then CheckSocketResult(WSAGetLastError, 'send'); Inc(Total, Written); Writeln(Written, ' bytes written to ForwardSock'); end; end; end; These are the last lines of the debug output: Checking ChannelSock Checking ForwardSock Checking ChannelSock Reading from ChannelSock 88 bytes read from ChannelSock 88 bytes written to ForwardSock Checking ForwardSock Reading from ForwardSock Has anybody ever used this code successfully for more than requesting a simple webpage?
  22. dummzeuch

    ssh tunnel with ssh-pascal

    I found my bug: I had for testing purposes changed the RemoteHost to one that requires different credentials, so log on failed. Now, having changed that back, the tunneling Remote Desktop works as expected. So your change works for me too. Thanks a lot! As for parallel connections: The unmodified LocalForward demo works for two different browsers in parallel. But after closing the second browser I get ESshError "LibSSh2 error: Unable to send channel-open request (-7), on API "libssh2_channeld_direct_tcpip_ex" in SshTunnel, line 170. This then happens every time I try to connect to http://localhost:12345/success.txt So there still seems to be something amiss.
  23. I have actually been using this "feature" when I needed an event handler but didn't have an object ready, by declaring a local variable of a simple class type declared just for this purpose, setting it to nil (just to shut up the compiler) and assigning its method to the event. That method simply doesn't do anything that requires self to have a value, so it works fine (it also must not be virtual). No constructor/destructor calls required and also no memory leak created. Alternatively one could create a plain procedure with the right signature, assign that to the code pointer of a TMethod record, leave the data pointer unassigned or set it to nil, and assign that record to the event using appropriate type casting. But that somehow feels hackier than the nil object instance.
  24. But you can easily check for nil, while that's not possible for "uninitialized". And you can also easily spot them in the debugger. Also, referencing a non-initialized object reference does not necessarily result in an access violation, while referencing nil definitely does.
×