Jump to content

All Activity

This stream auto-updates     

  1. Yesterday
  2. Stefan Glienke

    Cromis.DirectoryWatch range error

    The WParam of TMessage is ultimately of type NativeUInt while the WParam parameter is of type Longint. Since Delphi 11 the default Debug config has Range and Overflow checks enabled which causes any signed to unsigned or vice versa assignment to possibly raise a range check error. Strictly speaking any assignment of signed to unsigned and vice versa is a potential defect - you can reveal them by turning W1071 on with {$WARN IMPLICIT_INTEGER_CAST_LOSS ON}
  3. I wrote a quick test app and then drilled down into some folders using the app and compared with the Mac's native "Finder" to look at a set of virtual machines. The Mac's Finder recognized the "Virtual Machines" entry as a folder and its file contents were the same list of virtual machines I can see in VMWare Fusion, each entry is a simple VM name, and the details pane shows when it was created, the bundle size, etc. My test app, using just the TDirectory and TPath classes, showed "Virtual Machines.localized" as a folder name and allowed me to drill into that folder and then again into one of the ".vmwarevm" files, listing all the .vmx, .vmdk, .plist, and other files that make up a virtual machine package. Same with the Applications folder: Finder shows the application icons whereas my app shows a ".app" extension for each entry which is a sub-folder that opens up the contents of the app giving me Info.plist, PkgInfo, etc. My conclusion is that your app will need to recognize the file extension or file type and handle it differently--or like @Remy Lebeau says, use the FileManager API directly.
  4. Unfortunately, I see nothing in Delphi that would allow you to use that flag in this situation. TDirectory.GetFiles() is just a wrapper for a typical SysUtils.FindFirst/Next() loop, so it handles whatever files and directories that loop would normally report. If a Package file is treated as if it were a directory (ie FindFirst/Next() returns TSearchRec.Attr with the faDirectory flag set), then TDirectory.GetFiles() is going to recurse into the Package's content if the SearchOption parameter is set to soAllDirectories (as it is in your example). Also, more importantly, FindFirst/Next() simply don't use the FileManager API to enumerate files, they use the POSIX opendir() and readdir_r() functions instead, which have no such skip-Package flag available. Unfortunately, the TDirectory.GetFiles() predicate is only called for files and not for directories (ie, only for items that do not have the faDirectory attribute). Which makes sense, since TDirectory.GetFiles() is looking for only files to add to its output array, so there is no point in it filtering out directories. To prevent TDirectory.GetFiles() from recursing into Packages automatically, you would have to call it with its SearchOption parameter set to soTopDirectoryOnly (which is its default value), and then manually call TDirectory.GetFiles() for any non-Package sub-directory you are interested in. Of course, TDirectory.GetFiles() won't report directories to you, so you would have to use a separate call to TDirectory.GetDirectories() (with SearchOption=soTopDirectoryOnly) and filter out the Packages as needed. Which means, your enumeration time is going to double from having to scan each directory twice. So, in this case, you will likely have to use the FileManager API directly, and not use TDirectory at all.
  5. Remy Lebeau

    MessageBox is hidden by a modal form

    To the Application->OnGetActiveFormHandle event, not to the Application->FOnGetActiveFormHandle data member. But yes, you get the idea. Not set a Form as active, no. The RTL is querying you to choose which Form window should be considered "active" at that moment. So, you would need to enumerate your existing Forms and decide which one you want the MessageBox to be on top of. But you don't actually make that Form window be focused. The RTL is merely establishing a Z-Order relationship between the MesageBox and its Owner window. It is not moving input focus around.
  6. You forgot "no calling each other nazi" (see Godwin's law)
  7. Since this is such sensitive debate, better set some base rules: no pulling hair no poking the eye no dropping hot coffee over the speaker desktop no high kick no low kick no wedgie let's try to keep this debate civilized
  8. You can easily find my email in ICS source code.
  9. Apple's developer documentation mentions: static var skipsPackageDescendants: FileManager.DirectoryEnumerationOptions An option to treat packages like files and not descend into their contents. I think that is the behaviour I'm looking for, but I'm not sure how I can achieve it with Delphi. Perhaps if I can determine which folders/paths are packages ahead of time, I could then use the Filter Predicate function to filter out all files on those paths: TDirectory.GetFiles(path, TSearchOption.soAllDirectories, MyFilterFunction);
  10. Thank you, I'm able to provide fully functional small example shortly but I'm not entitled to publish credentials for mentioned testing service. Would you be so kind and could you send me (my e-mail is yamaco@yamaco.cz) the e-mail address which I can use for sending example and credentials? Thank you. Karel
  11. In your Yamaco1request.txt, I don't see the the same http header lines, including Authorization which is at least needed. Your code is wrong. Please post a complete, small, minimalist example of code which reproduce the problem you have.
  12. Alexander Sviridenkov

    ANN: HTML Office Library 4.6 released

    I'm glad to announce a new release of the HTML Office Library: 100% native and cross-platform Delphi library for conversion and displaying documents of the following types: Rich Text Format (RTF) MS Word 6-2007 binary format (DOC) MS Word XML document (DOCX) MS Power Point binary format (PPT) MS Power Point XML format (PPTX) MS Excel binary format (XLS) MS Excel XML format (XLSX) MS Excel XML binary format (XLSB) Adobe PDF format (PDF) Supercalc format (SXC) EPUB (electronic books). FB2 (electronic books). Markdown. Outlook Message (MSG) MIME message (.EML) Outlook databases (.OST, .PST) The Bat! database (.TBB) RAR archives ZIP archives Whats's new 1. Improved conversion quality for all document types. 2. Significantly improved conversion speed and memory consumption for all document types. 3. Reduced size of converted document for all document types. 4. Document to text conversion is now much faster (direct text extraction and use of SAX parser for XML). 5. Added support for MIME mail messages .EML (including attachments). 6. Classes for reading Outlook databases (.PST, .OST). 7. Classes for reading RAR archives. 8. Classes for reading The Bat message folders (.TBB). 9. New THtOfficeDocument.AsThumbnail function for creating document thumbnail. 10. Added support for password protected office files (OnPasswordRequest callback in converion methods) 11. New THtOfficeDocument.ConvertStreamtoText for converting to text with support for callback function which get next portion of text during conversion. 12. New MaxLines and MaxPages properties to limit size of converted document. 13. Converted Word/RTF documents can have paged and web layout. 14. Direct PDF export for all platforms (no OS or third party library used). 15. Fully functional text search engine (can index documents from any souce: file, archive, database, etc. using implementation of IHtVirtualFolder interface). Conversion speed measurements: There are two compiled demos available (source code of both applications is included): 1. Simple document viewer: allows to view any document on hard drive using file tree on left side and HtPanel on right. https://delphihtmlcomponents.com/FileBrowser.zip 2. Search Engine demo: create full text search index for documents located in selected folders and find any document from application or Web. https://delphihtmlcomponents.com/SearchEngine.zip This demo also shows the following features of THtSearchEngine: Date map - found document number by year Type Map - found documents by category Completion Test on sample database: Note that search time depends only on amout of found/shown documents and do not depend on total document count. https://delphihtmlcomponents.com/office.html
  13. I'm using System.IOUtils TDirectory.GetFiles function to list files (and recurse into subfolders) on macOS. Trouble is, in addition to normal folders, it is also listing the contents of Packages. For example, if I ask GetFiles to recursively scan the standard /Pictures folder, the internal contents of the PhotosLibrary.photoslibrary package also gets added to the list. This sort of makes sense in a way, since on macOS a Package is essentially a special kind of folder: In Finder I can right-click on a Package and select View Package Contents. Question is though, how can I prevent GetFiles from looking inside and listing Package contents, and just return a list of the files a user would normally see, instead?
  14. I've been using the freeware Cromis.DirectoryWatch for many years. I recently grabbed a much more recent version (from 2018) from here: https://github.com/CPsoftBE/BackupOfCromis. And reworked my code to use it on Windows 10, Delphi 11.2. It works great, except when I hit CTRL-ALT-DEL, when I get the range error shown below. I confess to being a total "script kiddie" when it comes to this kind of deep OS code. It appears the "if Assigned()"-code block is only done when a user enters CTRL-ALT-DEL. Perhaps this error deliberately caused by Microsoft when someone does CTRL-ALT-DELETE? I don't want to just ignore this problem, but don't have any idea how to safely fix it. Any suggestions?
  15. vshvetsov

    MessageBox is hidden by a modal form

    Do you mean, I may write a ApplicationGetActiveFormHandle function, assign the function to Application->FOnGetActiveFormHandle, and set any form as an active form? Couldn't this mess up the Application object? After all, the object uses GetActiveFormHandle in other situations as well?
  16. Steve Maughan

    TChromeTabs for Delphi 11?

    @corneliusdavid many thanks! I didn't know that only the 32 bit runtime was needed. Everything seems to work perfectly!
  17. vshvetsov

    MessageBox is hidden by a modal form

    The function Func() belongs to the "kernel" part of my code, it doesn't know anything about forms. In fact, all my kernel functions, when they want to give a message, generate a special MyKernel.OnMessage(string, MB_flags) event. In the "interface" part of the program, a general response to this event is implemented. It simply passes string and flags to an Application->MessageBox. When a OnMessage event is generated by kernel functions, different forms can be active (and are not guaranteed to have focus). To determine an active form I would need to write a complex code. But I just need to display a message on the screen so that it is guaranteed to be visible. It's a pity, if it is not possible. Maybe it will help to explicitly specify the MB_TOPMOST flag in a MessageBox?
  18. No idea what order you are making those requests, but you only send authentication in Sopaui2request.txt which works fine. Authentication has nothing to so with TSslContext. Angus
  19. Angus Robertson

    TSslWSocket instead of TWSocket

    If you connect to an SSL server, several events may be called to allow you to check ALPN and SSL certificate chain, but they are optional. There are several SSL demos that illustrate all this. Angus
  20. corneliusdavid

    TChromeTabs for Delphi 11?

    There are two packages, ChromeTabs_R.dpk and ChromeTabs_D.dpk. The "_R" is the run-time only and supports both 32-bit and 64-bit. The _D package is the Delphi component and is the one that gets installed in Delphi and does not ship with applications. Delphi is 32-bit only so components also have to be 32-bit only. So if you compile both 32-bit and 64-bit platforms of ChromeTabs_R.dpk then install only the 32-bit platform ChromeTabs_D.dpk, you'll have 32-bit and 64-bit support for the components in your application. I just compiled and ran the 64-bit version of the demo that comes with the package so I know it works.
  21. We use TWSocket which uses the OnDnsLookupDone event. I have replaced TWSocket by TSslWSocket (childclass of TWSocket). SSL is conditional, depending on a setting. In case SSL is applicable, which extra events do I use and in which order?
  22. Steve Maughan

    TChromeTabs for Delphi 11?

    Strangely, on my old computer running Delphi 10.4 I only had a win32 version of DesignIDE.dcp yet TChromeTabs installed fine on win64 via GetIt
  23. Steve Maughan

    TChromeTabs for Delphi 11?

    @corneliusdavid & @Fr0sT.Brutal — Many thanks! I managed to compile for 32 bit but not for 64 bit. It needs "DesignIDE.dcp" which is available in the following location: C:\Program Files (x86)\Embarcadero\Studio\22.0\lib\win32\debug\designide.dcp It seems it's not available for Delphi 11.1 64 bit — any ideas?
  24. dummzeuch

    GExperts Toolbar Dark Mode

    I just had to look it up myself, so here is what I found: The code for registering the GExperts actions with the IDE is TGXActionBroker.RegisterActionWithIde in GX_ActionBroker. This method is called from .RegisterAction and .RegisterMenuAction which in turn are called from various places within GExperts. The bitmap to use as an icon is passed as a parameter to that method. so if you grep for RegisterAction and RegisterMenuAction you should be able to find where these bitmaps come from. Most of those bitmaps probably come from a call to GxLoadBitmapFromResource in GX_Utils, which loads these bitmpas from the resource file GXIcons.res (located in the images folder of the GExperts sources which is linked into the DLL. That resource file in turn is generated from the bmp files in the same directory. So I guess it would be possible to somehow manipulate these bitmaps when they are being loaded or load different bitmaps for dark mode. Not sure whether that covers all bitmaps though.
  25. Greetings, thank you for your response and advices. I caught the communication in both cases (SoapUI and my app powered by ICS) and here are the results: SoapUI: I see two consequent requests, first one returns authorization which is used in the second request's header then. My app: Only first request is sent and the process stops because of unauthorized. No second request. I enclosed the appropriate files that illustrate the content of particular requests and responses. Is the requested behavior a matter of settings certain properties of SSLSecurityContext? Thank you for any help. All the best, Karel Yamaco1response.txt Yamaco1request.txt Sopaui2response.txt Sopaui2request.txt Sopaui1response.txt Sopaui1request.txt
  1. Load more activity