Jump to content

Remy Lebeau

Members
  • Content Count

    387
  • Joined

  • Last visited

  • Days Won

    26

Remy Lebeau last won the day on February 7

Remy Lebeau had the most liked content!

Community Reputation

255 Excellent

4 Followers

Technical Information

  • Delphi-Version
    Delphi XE2

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Remy Lebeau

    ShellExecute and passing of password

    Then DON'T pass the password on the command-line, use an IPC mechanism instead, such as a pipe, or even anonymous shared memory (coupled with this), or if you really want to be sneaky, there is an undocumented way to pass arbitrary data (up to 65531 bytes) to a child process via CreateProcess() (be careful though, it doesn't work under WOW64).
  2. Remy Lebeau

    Debug visualizers

    Um, because they are not actually easy to make. One needs to have a basic understanding of writing design-time packages and working with the OpenTools API, and a working knowledge of using the Visualizer API correctly, which can actually be a real PITA to work with.
  3. Remy Lebeau

    Why upgrade?

    In my company, I still use C++Builder 6 every single day. Our team WANTED to upgrade over the years, but upper management always said no for one reason or another. Either the IDE was too buggy, or the price was too high (both for the IDE, and for licensing 3rd party libraries we use), or the new features weren't beneficial enough to our work. Our company was bought by a competitor a few years ago and I'm the last remaining legacy developer, maintaining our software which is now on life-support pending its final end-of-life at the end of this year. Yeah, our company made that move years ago, writing new software in C# and maintaining existing software in C++. Our C# products don't hold a candle to our C++ software. Our C++ software took months to release to market and takes days to fix (usually), but our C# software took years to release to market and takes weeks/months to fix. The C# code is just so much more ugly and overly complex compared to the C++ code. At the time, I was glad to have never had to work on the C# products, but now I'm last man standing who can ever work on it, so I'm having to learn about it as I go.
  4. In my company, we wrote our own logging solution from scratch for all of our apps to log to. It consists of a Windows service hosting an out-of-process COM server, managing a thread-safe FIFO queue of log entries. A background thread continuously writes the entries to a log file, stopping and starting a new file at night and archiving the old files, purging old records/files at scheduled intervals, etc. Another thread forwards certain log entries to a secondary service running on another machine, to email, to SNMP traps, etc. Our individual apps use the service's COM object to send log entries and other commands as needed. Under heavy load, it easily handles 1000s of log entries per second across multiple processes. And if a given app crashes, COM handles the cleanup for us. And then we have a separate viewer app to display the log entries in real-time. This is probably a bit extreme for your use case, though. Existing logging tech wasn't very good way back when this project was first started.
  5. Remy Lebeau

    FTP add virtual directory

    Or the one in Indy (TIdFTPServer). Not in FTP, no. That is simply not how the FTP protocol works. The client has to login up front at the beginning of the FTP session, and cannot re-login again afterwards without disconnecting first. Like Angus said, you will basically have to create your own FTP server that you have complete control over. A pre-existing server, like IIS, is not really going to help you with this kind of task. Statically defined virtual folders, yes. But dynamically defined virtual folders, no. Server components like the ones in ICS and Indy give you direct access to the client's commands, and virtual folders is really not that difficult to implement when you have direct access to the paths the client is trying to access. I once wrote a virtual folder manager for Indy (I don't have it any more, though), it is just a matter of splitting a requested path into its individual parts and then walking the parts resolving each one to a physical folder as needed until you end up with a final physical path. So, in your case, when the user starts the transaction, you create the virtual folder in your DB/whatever and make sure that folder is resolvable to a physical folder and is included in directory listings as needed. When the transaction is done, delete the virtual folder from your DB/whatever. If the client requests a path that includes a virtual folder that is no longer resolvable, a standard FTP 55x error response, like 550 or 553, will suffice to let the client know the path is no longer valid.
  6. Remy Lebeau

    MMsystem and Joystick

    Then you are just going to have to debug the code at runtime to find out what is really happening. The OnJoyMove event is fired by an internal TTimer that calls joyGetPos() at regular intervals and then compares the latest coordinates and button states for any changes from the previous call. The fact that you get the OnJoyMove event fired at least once means the timer is running and polling correctly. So either you are doing something to block that timer from firing again, or maybe you are deactivating the TJoystick without realizing it, or maybe joyGetPos() itself is failing. We can't debug for you, because we can't see your real code. FWIW, manually polling the hardware at regular intervals is not the best way to go. Makes me wonder why TJoystick was not written from the beginning to use joySetCapture() instead to allow the OS to send its own event notifications to the app. No, this is likely not related to FMX at all - unless FMX's TTimer is broken. Although, do note that TJoystick is using Windows-specific APIs, so it won't work on any non-Windows platforms that FMX supports.
  7. Replace the try..finally with try..except instead, then it will be fine: constructor TMyClass.Create(_SomeInstance: TSomeOtherClass); begin inherited Create; // other code here // don't take ownership unless everything above is fine... FSomeInstance := _SomeInstance; end; ... MyInstance := nil; try SomeInstance := TSomeOtherClass.Create; try MyInstance := TMyClass.Create(SomeInstance); except // ownership of SomeInstance is not taken, so free it now... SomeInstance.Free; raise; end; // ownership of SomeInstance is taken, will be freed when MyInstance is freed... ... finally MyInstance.Free; end;
  8. Remy Lebeau

    tStringGrid.OnDrawColumnCell - hot to get column field name?

    If there is, I haven't found it yet. It is very easy in VCL (TColumn.Field and TColumn.FieldName), but apparently is more difficult in FMX (why? This is one of many reasons why I hate FMX, it over-complicates things that used to be easy). I suggested using TColumn.Header after reading this answer to FMX.TGrid how to allow user to move columns without messing up the data, which shows the TColumn.Header being used in a call to TClientDataSet.FieldByName().
  9. Remy Lebeau

    tStringGrid.OnDrawColumnCell - hot to get column field name?

    You are on the right track. You need to use the Column parameter. In this case, you can use the TColumn.Header property to know which column is being drawn.
  10. Remy Lebeau

    Receiving incoming calls

    Was there something wrong with the example I gave you in my previous reply?
  11. Um, do you see a try..finally in the example I provided? No. That example does not use one. The previous example did. 2 different scenarios.
  12. Remy Lebeau

    Indy10 rev 3627 into D10.3.3?

    Fix checked in.
  13. Remy Lebeau

    Indy10 rev 3627 into D10.3.3?

    I have checked in .dproj files for 10.3 now. I don't know if they work. I don't really use .dproj files myself, and I don't have 10.3 installed to make them for me, so I just copied the files from 10.2 and tweaked them. Otherwise, you can just open and compile the individual .dpk files instead and let the IDE generate new .dproj files. Fixed now. Fixed now.
  14. Another option would be to release ownership if the constructor fails, that way the caller retains ownership until the constructor is successful: constructor TMyClass.Create(_SomeInstance: TSomeOtherClass); begin inherited Create; FSomeInstance := _SomeInstance; try // other code here except FSomeInstance := nil; raise; end; end; Or, you could simply not take ownership until the very end after everything else is successful: constructor TMyClass.Create(_SomeInstance: TSomeOtherClass); begin inherited Create; // other code here FSomeInstance := _SomeInstance; end; If something needs to be called during construction that requires FSomeInstance, modify that something to let the constructor pass _SomeInstance to it as a parameter: constructor TMyClass.Create(_SomeInstance: TSomeOtherClass); begin inherited Create; // other code here DoSomethingWith(_SomeInstance); FSomeInstance := _SomeInstance; end;
  15. Same with SvCom, written by Aldyn Software (this is the one I use). In fact, there are quite a few 3rd party TService replacements available. Or, you could simply make a copy of SvcMgr.pas and patch TService yourself.
×