Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 03/20/24 in all areas

  1. This is definitely because the .dpk has LF line endings. Steps to reproduce manually: 1. Open SynEditDR.dpk in Notepad++. Make sure "rrequires", "ocontains", and "d." are all fixed and correct. 2. Turn on View -> Show Symbol -> Show End of Line so you can see the end of line characters. 3. Convert SynEditDR.dpk to Unix line endings in Notepad++ with Edit -> EOL Conversion -> Unix (LF) and save 4. Open SynEditDR.dpk in Delphi 12 5. In the project manager, right click on SynEditDR290.bpl and select Options... 6. In the Project Options window make no changes and click the Save button 7. Click Save All on the toolbar or use File -> Save All.. 8. Now go back to Notepad++. It will have detected that the .dpk has changed. Reload the file and you'll see that it's now corrupted with a mix of LF and CRLF line endings, and the usual "rrequires", "ocontains", and "d." problem. If you do exactly the same thing but start by making sure the .dpk has CRLF line endings then there is no corruption of the file.
  2. Elliot Hillary

    DelphiLint v1.0.0 released!

    We're excited to announce the release of DelphiLint v1.0.0, a free and open-source static analyzer and linter for the Delphi IDE! DelphiLint is powered by SonarDelphi, our Delphi analyzer for the SonarQube code quality platform that scans entire codebases with more than 120 different rules. With DelphiLint, the feedback loop is shortened - it allows you to analyze individual files within your editor and correct problems before they're even checked in. GitHub: https://github.com/integrated-application-development/delphilint Release: https://github.com/integrated-application-development/delphilint/releases/tag/v1.0.0 Features Analyze one or more files on demand View detected issues, descriptions, and rationale inline in the Delphi IDE Two analysis modes: Standalone - run analyses entirely locally with a default set of active rules Connected - connect to a SonarQube instance, allowing for Fetching of active rules and configuration from the server's configured quality profiles Suppression of issues that have been resolved in past analyses Usage of the server's version of SonarDelphi Uses the same rules and configuration files as SonarDelphi, making configuration easy for projects that already use SonarDelphi for code quality DelphiLint supports RAD Studio for Delphi 11+. Feedback and contributions are welcome!
  3. Before anyone gets too upset, my perspective is based on dealing with legacy code you have come into. There are numerous advantages to encapsulating global variables. Not only do you establish a measure of access control, but if you expose them as properties with getters and setters, you can easily set breakpoints to discover points of interaction. Equally, you could introduce logging. But even without those benefits, you will be altering the calling code to reference MyGlobals.SomeState, rather than simply SomeState. Once you have accomplished that tedious task, it is also a simple matter to search for all such references by searching on MyGlobals. Other benefits will become apparent as you work through things.
  4. I solved it. There was still a node for "RAD Studio 12" in the Windows 10 uninstall registry. So I simply deleted that node from here: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ PS. Using VM for multiplatform development is a PITA.
  5. There is no such incompatibility. It's just 64 to 32 bit value truncation caused by defective code.
  6. Dave Nottage

    DRM video player

    ALFmxVideoPlayer uses ExoPlayer (which supports DRM) for Android: https://github.com/Zeus64/alcinoe/blob/master/source/ALFmxVideoPlayer.pas You might be able to at least learn from the code.
  7. Congrats. I got used to VM, running a Windows VM on a Mac made it easy to develop for three platforms (Win, macOS, iOS)... never tried Android, but should work out.
  8. The key here is that PPLFHANDLE is 32 bits in a 32 bit process and 64 bits in a 64 bit process. So you need a type that has the same property. For instance any pointer, or NativeInt or NativeUInt. Now, in this case it seems that the expedient thing to do is to declare PPLFHANDLE as HGLOBAL. And in the Delphi winapi units HGLOBAL will be declared as a type that switches size based on process bitness. Actually it's NativeUInt but that's actually a detail you don't really need to know. Although it's nice to know it and help confirm the understanding! So I would do this: type PPLFHANDLE = HGLOBAL; LPPPLFHANDLE = ^PPLFHANDLE; function pp_lfopen(filename: LPSTR; lfflags: LONG; lftype: LONG; password: LPSTR; handle: LPPPLFHANDLE): LONG; stdcall; Here I am using the same types as the header file. I generally think that it's preferable to keep an API translation as close to the original as possible. The header file is a bit odd in the way it defines these types: #ifndef PPLFHANDLE #ifdef _WIN64 #define PPLFHANDLE HGLOBAL #else #define PPLFHANDLE LONG #endif #endif #ifndef LPPPLFHANDLE #ifdef _WIN64 #define LPPPLFHANDLE HGLOBAL * #else #define LPPPLFHANDLE LPLONG #endif #endif It looks like an earlier version wrongly declared PPLFHANDLE as LONG and then they've kept that mistake as they catered for 64 bit. This header code should really look like this: #ifndef PPLFHANDLE #define PPLFHANDLE HGLOBAL #endif #ifndef LPPPLFHANDLE #define LPPPLFHANDLE PPLFHANDLE * #endif
  9. http://docwiki.embarcadero.com/RADStudio/Athens/en/64-bit_Windows_Data_Types_Compared_to_32-bit_Windows_Data_Types
  10. This is classic AI spammer tactic. Post AI on random posts to make it look like user is actively participating, and then separately they also post blatant spam.
  11. aehimself

    How to check for Delphi update?

    If there is a new patch / version available it will always show up in this forum. This is how I get informed 🙂
  12. Roger Cigol

    TFileStream vs ifstream/ofstream

    "Which is the best way?" questions in C++ are always tricky! The language has evolved so much (and continues to do so). We C++ Builder users have the added complication of the use of the VCL or FireMonkey functions (that come from the Delphi RTL). How important it is to keep your code portable is certainly one question to consider. Re: text files : also take into account encoding possiblities - if you need to anticipate different encodings then the VCL support is often the easiest route. I tend to use TStringList as the store and then the LoadFromFile() and SaveToFile() functions.
  13. @dan27125 I commented earlier on your same question on StackOverflow: https://stackoverflow.com/questions/77868076/collect-json-ajax-data-from-a-local-zigbee-web-server Now that I see this post, the StackOverflow post appears to be a direct copy/paste of this post? That would explain why it mentions "Attached is ajax.xml, debug.html" without actually providing those files. It is generally frowned upon by internet etiquette to post the same question in multiple forums at the same time. It shows a lack of patience on your part, and a disrespect for people who might take time out of their day to answer. That being said, now that I see the relevant data files are on this post and not the StackOverflow post, I can fill in some gaps from my StackOverflow comment. The HTML is running a client-side JavaScript that uses a timer to invoke the browser's built-in AJAX client at regular intervals to send an HTTP request to download the XML file, parse the XML, and inject the results into the HTML elements using the browser's DOM. There is no streaming involved at all, each data update is an independent HTTP request. In C++Builder, you would simply do the same thing. Run a timer that uses any HTTP client you want (TIdHTTP, T(Net)HTTPClient, libcurl, etc) to download the XML from the appropriate URL, and then you can use any XML library, such as (T|I)XMLDocument, to parse the XML and do what you need with the data values.
  14. Had same issue.. sdkmanager "platform-tools" "platforms;android-33" this command will install the platform-tools which are also missing.. sdkmanager pretty sure my issue was due to an older version of java during install, sdkmanager fails to run.. make sure java paths are set for both 32 and 64 bits, i forgot one.. no more compile errors anyways.. thanks! ~q
  15. It's likely because you have an incompatible JDK present on the machine. This is a potential fix: 1. Make sure JAVA_HOME environment variable is set to the Adoptium JDK: JAVA_HOME=C:\Program Files\Eclipse Adoptium\jdk-11.0.15.10-hotspot 2. Add missing build-tools by going to: C:\Users\Public\Documents\Embarcadero\Studio\23.0\CatalogRepository\AndroidSDK-2525-23.0.50491.5718\cmdline-tools\latest\bin In a command prompt and issue these commands: sdkmanager “build-tools;33.0.2” sdkmanager “platforms;android-33”
  16. In your case, I would put the variables you are working with in a class or even a record and set the scope to what you selected as private to the thread. Keep it simple, its all about preventing access from multiple threads. If you have a global variable that needs to be accessed by multiple threads, protect the access using some sort of semaphore, such as a critical section or spin lock.
  17. Why does the Delphi IDE still not handle line endings properly? Just wondering.
×