Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/27/25 in all areas

  1. Hi From the contacts I have from time to time following presentations or training courses, it seems that I'm better known for the video game coding part of my hobby than for the other stuff. It's true that I find it more fun (especially to stream on Twitch), but I also have utilities for Delphi developers created to simplify my life that I make available as binaries and source code on my GitHub account. App Stores Screen Captures Generator : to generate all the needed images from your screen captures when you have to publish your softwares on current app stores Copyright Pascal Projects : to add a copyright text in the header of each PAS/DPR files of a folder tree DProj To Windows Setup : to generate the Windows setup from Delphi deployment wizard data. It uses Inno Setup to create the install program and Exe Bulk Signing to sign the exe files. Exe Bulk Signing : a local and network signing program for Windows executables (exe+msix). It has an API you can use to integrate it in your projects like I did with "DProj To Windows Setup". Folder to FMX Image List : to create a FireMonkey TImageList to copy paste in your project or in a data module unit from all images in a folder tree. It fills the multires bitmaps depending on file names. Google Play Developer Banner Generator : to create a picture to use has your Play Store developer banner composed by a random collage of images you add to your project. I use it with icons of my Android apps. HTML Writer : to simply get HTML source code or WYSIWYG HTML content. I use Delphi HTML Components library in this program to have the WYSYWYG HTML editor and a memo for the source code tab item. Pic Mob Generator : my icons generator from basics layers or images, SVG, paths or rectangles. It export JPEG&PNG images, ICO and ICNS files. For the SVG I used RiverSoftAVG SVG Component Library, but next release will use Skia4Delphi. SM Code Generator : I use it in some multi players games, for EXE Bulk Signing API and client projects. The program generates Delphi code you only have to use in your projects to have a client / server solution to exchange formatted messages over IP. The library uses standard TCP sockets from Embarcadero (with no external dependencies). SVG Folder to Delphi Unit : to import SVG files as Pascal strings in your projects. I use it in some games with Skia4Delphi to show icons or sprites. The program generates a unit (compatible with Delphi 12.X and higher) with SVG found in a folder. Some of these programs are available from GetIt. The others will be submitted before the end of the year. The download links are on their GitHub repositories and will be added to their websites (which should be redirected to GitHub in the meantime). If you need changes in these programs or have suggestions, be free to tell here or as issues on their repositories. I'm also looking for ideas of simple tools to develop during live coding streams to show Delphi or web solutions. They are distributed as shareware programs. Contributions and sponsoring are welcome but not obligatory, and there are no program restrictions in the absence of a valid license. All features are available for free.
  2. I have some more testing to do, but I can confirm that using TFDScript behaves like I'd imagine. Thank you very much. So that leaves 2 options so far: * Use TFDScript * Have a 2nd TFDConnection that's in charge of handling multi command transactions.
  3. Another thing: I totally get using TFDQuery out of habit but don't forget that there is the more lightweight TFDCommand or TFDConnection.ExecSQL for doing INSERT, UPDATE and DELETE.
  4. Remy Lebeau

    Access violation with move command

    That is wrong. Your original call was correct. It is your Move() call inside of TargetMethod() that was wrong to begin with. It needs to be this instead: Move(Events[0], p^^, TotalSize); Inside of TargetMethod(): - p is a pointer to Main's Data variable. - p^ refers to the Data variable itself. - p^^ refers to the memory block that the Data variable is pointing at. The 2nd parameter of Move() takes a var reference to the memory it will write to. So it needs a reference to the memory block that the Data variable is pointing at, but you are giving it a reference to the Data variable itself. Thus, this call to Move() writes to the call stack of Main(), corrupting it. That is why the 2nd call to Move() inside of Main() crashes when it tries to read from the memory pointed at by the Data variable which resides in the now-corrupted call stack. You likely overwrote the Data variable during the 1st Move. Imagine how your Main() would need to use its Data and DataSize variables if it didn't have to pass them to TargetMethod() at all: procedure Main; var Data: Pointer; DataSize: Integer; ByteArray: TBytes; TotalBytes: Integer; begin ... GetMem(Data, ...); // <-- No ^ here Move(..., Data^, ...); // <-- 1 ^ here DataSize := ...; // <-- No ^ here ... if (Data <> nil) and (DataSize > 0) then try TotalBytes := DataSize; SetLength(ByteArray, TotalBytes); Move(Data^, ByteArray[0], TotalBytes); // <-- 1 ^ here finally FreeMem(Data); end; ... end; Now, because you added @ to Data and DataSize when passing them to TargetMethod(), you need an extra ^ on all accesses to Data and DataSize inside of TargetMethod(): GetMem(p^, TotalSize); // <-- 1 ^ here Move(..., p^^, ...); // <-- 2 ^ here len^ := ...; // <-- 1 ^ here
  5. That is not true. During a task switch between two threads, CPU register values are preserved for the thread that is being switched from, and they are restored when that thread is switched back to. So threads cannot overwrite each other's register values. And the variables in question are all local to the calling thread's call stack, so they can't be overwritten by other threads, either (at least, in this example, anyway). The only way that values could possibly be overwritten are from variables that are being shared across thread boundaries (which is not the case in your example), and such overwriting is going to be sensitive to the timings between thread switches, so you are not guaranteed a particular result one way or the other whether you use the intrinsic exchange or class-wrapped exchange. I think you are misdiagosing the problem (if there even is a problem). Yes, the class version of the exchange is clearly less efficient than the intrinsic, but that doesn't mean the class version is any less thread-safe.
  6. Why? What in that assembler makes you think that? TInterlocked.Exchange(pointer, pointer) and TInterlocked.Exchange(TObject, TObject) are both implemented with a call to AtomicExchange. That's the: call $003819a8 There's no type conversion as such. The compiler just doesn't inline the call as it should.
  7. corneliusdavid

    Delphi 7 quirks & gaffs

    Try exiting Delphi, removing temp files like .dsk, .ddp, .dcu, and others, then restart Delphi and do a build-all. I've found that helps the source/debug line alignments. As for the function value return warning--I dunno!
×