Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 03/08/22 in Posts

  1. tinyBigGAMES

    CPas - C for Delphi

    Overview What if you were able to load and use C99 sources directly from Delphi? There is a vast quantity of C libraries out there and being able to take advantage of them, without being a pain would be nice. You could even compile a bunch of sources and save them as a library file, then load them back in from disk, a resource or even from a stream. You can get the symbols, map to a C routine, and execute from the Delphi side all from a simple API. Downloads Releases - These are the official release versions. Features Free for commercial use. Allow C integration with Delphi at run-time. Support Windows 64-bit platform. Support for C99. Fast run-time compilation. Can run C sources directly or compile to (.LIB, .EXE, .DLL). Library files can be loaded and used at run-time from a file, a resource or stream. Import symbols directly from a dynamic linked library (.DLL) or module-definition (.DEF) file. You can reference the symbols from Delphi and directly access their value (mapping to a routine and data). Your application can dynamically or statically link to CPas. Direct access to the vast quantity of C99 libraries inside Delphi. Minimum System Requirements Delphi 10 (Win64 target only) FreePascal 3.3.3 (Win64 target only) Microsoft Windows 10, 64-bits 20MB of free hard drive space How to use in Delphi Unzip the archive to a desired location. Add installdir\sources, folder to Delphi's library path so the CPas source files can be found for any project or for a specific project add to its search path. Add installdir\bin, folder to Windows path so that CPas.dll file can be found for any project or place beside project executable. See examples in installdir\examples for more information about usage. You must include CPas.dll in your project distribution when dynamically linked to CPas. See CPAS_STATIC define in the CPas unit file. See installdir\docs for documentation. A Tour of CPas CPas API You access the easy to use API in Delphi from the CPas unit. {.$DEFINE CPAS_STATIC} //<-- define for static distribution type { TCPas } TCPas = type Pointer; { TCPasOutput } TCPasOutput = (cpMemory, cpLib); { TCPasExe } TCPasExe = (cpConsole, cpGUI); { TCPasErrorMessageEvent } TCPasErrorEvent = procedure(aSender: Pointer; const aMsg: WideString); { Misc } function cpVersion: WideString; { State management } function cpNew: TCPas; procedure cpFree(var aCPas: TCPas); procedure cpReset(aCPas: TCPas); { Error handling } procedure cpSetErrorHandler(aCPas: TCPas; aSender: Pointer; aHandler: TCPasErrorEvent); procedure cpGetErrorHandler(aCPas: TCPas; var aSender: Pointer; var aHandler: TCPasErrorEvent); { Preprocessing } procedure cpDefineSymbol(aCPas: TCPas; const aName: WideString; const aValue: WideString); procedure cpUndefineSymbol(aCPas: TCPas; const aName: WideString); function cpAddIncludePath(aCPas: TCPas; const aPath: WideString): Boolean; function cpAddLibraryPath(aCPas: TCPas; const aPath: WideString): Boolean; { Compiling } procedure cpSetOuput(aCPas: TCPas; aOutput: TCPasOutput); function cpGetOutput(aCPas: TCPas): TCPasOutput; procedure cpSetExe(aCPas: TCPas; aExe: TCPasExe); function cpGetExe(aCPas: TCPas): TCPasExe; function cpAddLibrary(aCPas: TCPas; const aName: WideString): Boolean; function cpAddFile(aCPas: TCPas; const aFilename: WideString): Boolean; function cpCompileString(aCPas: TCPas; const aBuffer: string): Boolean; procedure cpAddSymbol(aCPas: TCPas; const aName: WideString; aValue: Pointer); function cpLoadLibFromFile(aCPas: TCPas; const aFilename: WideString): Boolean; function cpLoadLibFromResource(aCPas: TCPas; const aResName: WideString): Boolean; function cpLoadLibFromStream(aCPas: TCPas; aStream: TStream): Boolean; function cpSaveOutputFile(aCPas: TCPas; const aFilename: WideString): Boolean; function cpRelocate(aCPas: TCPas): Boolean; function cpRun(aCPas: TCPas): Boolean; function cpGetSymbol(aCPas: TCPas; const aName: WideString): Pointer; { Stats } procedure cpStartStats(aCPas: TCPas); function cpEndStats(aCPas: TCPas; aShow: Boolean): WideString; If you want CPas to be statically bound to your application, enable the {$CPAS_STATIC} define in the CPas unit. How to use A minimal implementation example: uses System.SysUtils, CPas; var c: TCPas; // CPas error handler procedure ErrorHandler(aSender: Pointer; const aMsg: WideString); begin WriteLn(aMsg); end; begin // create a CPas instance c := cpNew; try // setup the error handler cpSetErrorHandler(c, nil, ErrorHandler); // add source file cpAddFile(cp, 'test1.c'); // link and call main cpRun(cp); finally // destroy CPas instance cpFree(c); end; end. Compatibility These are some libraries that I've tested. If you have tried more, let me know and I can add them to the list. miniaudio (https://github.com/mackron/miniaudio) raylib (https://github.com/raysan5/raylib) sfml (https://github.com/SFML/CSFML) stb_image (https://github.com/nothings/stb) stb_image_write (https://github.com/nothings/stb) stb_truetype (https://github.com/nothings/stb) stb_vorbis (https://github.com/nothings/stb) Media ❤ Made in Delphi
  2. I recently upgraded my old C++ Builder 2009 to C++ Builder 11. It was time .. and I wanted to make use of the new GUI improvements (Styles, Scaling, High DPI etc). GUI stuff in other words. To that end I spent a lot of money to get a license. Everything is relative, but to me this is the biggest investment in quite some time and the biggest software investment ever. I have always been happy with Builder 2009 and yes, there were some issues that I had to work around, but not too many. Since I have upgraded I have already reported close to 20 bugs. Never ever did I have to .. It's also making me nervous as to when these things will get fixed, if at all, as it impacts my work. The silver lining at least was that my bugs triggered interaction. I saw them being escalated to development or they were assigned to me again to provide more information. All that has stopped in the last few weeks. For all the last bugs there has been zero interaction. Nothing, as if nobody cares. The GUI work involves custom controls for which I need the help files, to be able to apply the Styles properly etc. In itself already poorly documented but for 3 weeks now docwiki has predominantly been unavailable. There are already other posts about that, so I won't get into the specifics of that, but it adds to what looks like a systemic failure. - Many bugs in the very features they're touting about and that convinced me to upgrade - Nothing appears to be done about it, nobody seems to care - Docwiki offline, nothing seems to be done about it, nobody (at embarcadero) seems to care The person most responsive in QA before and who has not responded anymore has a Ukrainian name. Perhaps coincidence, perhaps my paranoia but how exposed is Embarcadero development and support to Ukraine. Is this the reason for all the recent issues ? If so, communicating about it would at least renew confidence. All this nonsense would not be necessary if they would just COMMUNICATE about the issues (docwiki for instance). The silence only feeds the idea of a failing company or at least a failing product and I feel bad for having invested my time and money in this at this stage. My 'happy life' with Builder 2009, the type of work I'm doing with it and the low exposure to issues may have made me blind to something that is well known and has been happening for years ? I don't know ? Maybe I shouldn't worry because this is business as usual ? In which case I wish I had done my homework though.
  3. If only there were someone at Embarcadero specifically tasked with communicating with the customers...🤔 Maybe @Jim McKeeth knows someone who can tell us what the hell is going on?
  4. Ömer Gözlek

    Firebase Adertising Problem After IOS 14

    I have just found the culprit. It is FireDAC.Phys.SQLiteWrapper.Stat unit. I will explain how did I reach this conclusion. I debugged the source and found that breaks at the constructor of TiOSFirebaseBannerAd in FMX.Advertising.Firebase.iOS unit. The first line of constructor which is TGADMobileAds.OCClass.sharedInstance.startWithCompletionHandler(nil) causes error. This line initializes the Admob library. But, my application id and banner id s are all correct since sample app works without problems. Then I started to add my original app's units to sample project step by step. Firstly, I found the unit which is causing the problem. After that, I focused on the units in its uses list. Finally I found the actual offending unit. It is FireDAC.Phys.SQLiteWrapper.Stat. I think something in its initialization section is causing the problem. Actually, I don't need that unit in my source code. It is a left over unit from my previous works. Thank you very much for your help on directing me towards the solution.
  5. Remy Lebeau

    Using COM to update Word docx files

    Try something like this: procedure update_toc(const docx_file: string); var word, doc: Variant; begin word := CreateOleObject('Word.Application'); doc := word.Documents.Open(WideString(docx_file)); doc.TablesOfContents.Item(1).Update; doc.Close(-1); word.Quit; end;
  6. Vandrovnik

    What is good replacement for FastReports?

    There is https://blogs.embarcadero.com/must-have-this-free-powerful-report-generator-for-your-windows-apps/ , I have not tried it.
  7. b1ol

    ANN: Skia4Delphi v3.0.2

    Hi @vfbb, thanks a lot! Yes, you're right, this is a FMX thing, I' should have checked... shame on me!!! ;-) Thanks again for this help and for the great work you're doing with Skia4delphi Have a nice day
  8. vfbb

    ANN: Skia4Delphi v3.0.2

    Hi @b1ol, the default HitTest of TSkSvg and TSkAnimatedImage is False. So, you need to set the property HitTest to True to use the mouse operations.
  9. I'm sorry but that is a joke not a roadmap. A couple of years earlier they have had real roadmaps. With information like when will be the next release and what we can expect (sometimes even a couple of minor versions). Now just Now / Next with no information. I'm sorry but that is not enough to plan release cycles and upgrade path for a production environment where you've to plan time for the upgrades in the code base. It's not always enough to install the new IDE, recompile and ship to the customers.
  10. They have a roadmap and have been updating it about once/year. Here's the info I've collected on it: https://github.com/ideasawakened/DelphiKB/wiki/Future-Releases-for-RAD-Studio-and-Delphi Marco covered the roadmap in the last DelphiCon.
  11. In the quality portal you get response while they validate your report and try to prove it's how the product works and not a bug. After that unfortunately there is no response at all (not even in which version and time frame when the fix will be shipped). Usually you will get no response about the issue at all. Do I think this is the right way? Of course not. As sometimes it's critical to us to know how to communicate with our clients as we have also to plan and communicate to clients when we can ship the fixed product. For some unknown reason who ever decides the future of the product cuts off the communications with the developers (there was a brief period when even on this forum you was able to get honest answers). Instead of a clear communication we can get only promotion materials how everything is nice and shiny (and that's true when you try hello world applications, but as soon as you try to do something more complication you will discover bugs). For me the latest bad sign is that they abandoned the idea that we should have a roadmap. Now you can only read the future of the products only from your coffee mug and that's not a fun thing to do when my managers asks me what is the next step.
  12. You can use the connection's OnWork events for that purpose. Just be aware that they are fired in the context of the thread that is performing the transfer, so if that is not the main UI thread then you will have to synchronize your UI updates with the main thread. https://www.indyproject.org/2021/02/10/links-to-old-indy-website-pages-are-currently-broken/ https://web.archive.org/web/20200925081341/http://ww2.indyproject.org/Sockets/Docs/Indy10Installation.EN.aspx That is a build script for C++Builder (hence the C in the filename), not for Delphi. Indy stopped using build scripts for Delphi after D2009. For Delphi, you can just open the project files directly in the IDE and use the Compile and Install options in the Project Manager. Of course, because 1) you didn't remove the old version from the IDE, and 2) the build script only compiles the library binaries, but it does not install them into the IDE. You have to do that step manually. Never use relative paths, always use absolute paths.
  13. We are glad to announce that New Multi-platform FM Style "Mirage Light" just released: https://www.delphistyles.com/fmx/MirageLight.html New style has specific of Windows 11 and macOS Monterey UI!
×