-
Content Count
3060 -
Joined
-
Last visited
-
Days Won
139
Everything posted by Remy Lebeau
-
CompareString function for UTF8 strings or buffers?
Remy Lebeau replied to MarkShark's topic in RTL and Delphi Object Pascal
The System.AnsiStrings.AnsiCompareStr() function uses the Win32 CompareStringA() function on Windows (the System.SysUtils.AnsiCompareStr() function uses CompareStringW() instead). But, CompareStringA() assumes the input strings are in the ANSI encoding of the specified locale. The MSDN documentation says: -
Strange bug with string literals in RAD Studio 12
Remy Lebeau replied to luebbe's topic in RTL and Delphi Object Pascal
I reported the issue to Embarcadero privately and they are looking into it. -
Interesting. I just tested that in 12.0 Patch 1 and sure enough the springing works. However, removing the 'else' does prevent the dragging from going smaller than the MinWidth to begin with.
-
As I said, I confirmed the bug does not exist in 10.3, but does exist in 12.0, so it's possible that it does not exist in 11.3 either. I don't have that version to check with. If you look in your IDE's copy of the Vcl.ComCtrls.pas source file, do you see the code I showed earlier?
-
Tested, works fine (also, you don't need to use "Self."). You can also use an inline variable to simplify your example further: procedure TAncestor.DoSomething; begin var md := ProcX; if TMethod(md).Code <> @TAncestor.ProcX then // Overridden. else // Not overridden. end; Do note that in the original TStream code, using @TStream.Seek like above won't work since Seek() is overloaded, so the compiler wouldn't know which overload to compare with. Hence the original code's use of a typed variable to resolve the ambiguity, eg: procedure TAncestor.DoSomething; type TProcX = procedure of object; var Impl, Base: TProcX; ClassTAncestor: TClass; begin ClassTAncestor := TAncestor; Impl := ProcX; Base := TAncestor(@ClassTAncestor).ProcX; if TMethod(Impl).Code <> TMethod(Base).Code then // Overridden. else // Not overridden. end; This works for both overloaded and non-overloaded methods. I have reported this enhancement to Embarcadero now: https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-548 As for the invalid cast errors, they are probably the compiler trying to CALL the method first, and then cast the (lack of a) return value. You have to do the comparisons through the TMethod record, and that requires a variable which you can type-cast.
-
I have now merged in your changes. For consistency, I re-arranged the order of the new directories that you had added.
-
IIRC, activation issues are now handled by SALES not SUPPORT.
- 3 replies
-
- xe5
- installation
-
(and 3 more)
Tagged with:
-
https://blogs.embarcadero.com/the-new-quality-portal-is-live-here-are-the-details/
-
OT? Forum credentials for C++ builder XE-5 install
Remy Lebeau replied to BruceV's topic in General Help
Also, Embarcadero's own forums (which still had nothing to do with Licensing) were shut down several years ago.- 3 replies
-
- installation
- xe-5
-
(and 1 more)
Tagged with:
-
Thanks, good catch. I'll fix it shortly and get it merged in.
-
The cleanup scripts don't INSTALL anything. They REMOVE the pre-installed copy of Indy they ships with the IDE. Nothing more. You have to then compile Indy yourself. By default, the projects are setup for Win32 only. You would have to configure the desired platforms as needed.
-
Hmm, it worked fine for me when I tested it on my system. I don't have 12.1 installed yet. Feel free to submit a Pull Request or email with any changes needed.
-
I already fixed that issue a month ago, and I told you that at the time:
-
How to initialize OpenSSL with MacOS 64 (x86 and ARM)?
Remy Lebeau replied to philipp.hofmann's topic in ICS - Internet Component Suite
RAND_screen was deprecated in OpenSSL 1.1.0 and hidden behind compatibility macros. So it is possible that it doesn't even exist in your copy of the OpenSSL libs. -
Neither of those types have the same size as string32. string32, aka string[32], is 33 bytes (1 byte length + 32 AnsiChars). This has not changed over the years. ShortString, aka string[255], is 256 bytes (1 byte length + 255 AnsiChars). This has not changed over the years. array[1..32] of Char is 32 bytes in D5, but 64 bytes in XE. There is no length byte in the array, and Char itself is different. Prior to 2009, it was AnsiChar. Post 2009, it is WideChar.
-
how to extract from tidhttpserver PostStrean
Remy Lebeau replied to billyb's topic in Network, Cloud and Web
That's not going to happen anytime soon, if ever. You will have to write your own function if you want that kind of functionality. MIME is complicated. No, the Dest stream only contains the body content (that is why the method is called ReadBody()). The Decoder has a Headers property, which is populated by the call to the ReadHeaders() method. The headers are stored as a TStrings in "name=value" format. You can use Indy's ExtractHeaderSubItem() function to get the "name" and "filename" attribute values from the "Content-Disposition" header. -
how to extract from tidhttpserver PostStrean
Remy Lebeau replied to billyb's topic in Network, Cloud and Web
TIdHTTPServer does not currently support extracting values from a "multipart/form-data" request (see https://github.com/IndySockets/Indy/issues/138). You have to parse the raw MIME data in the PostStream yourself. You can use Indy's TIdMessageDecoderMIME class to help you with that. See https://en.delphipraxis.net/topic/10918-multipartform-data-vs-x-www-form-urlencoded-indy-http-server/ for an example. -
TStringStream inconsistent results
Remy Lebeau replied to Mark Williams's topic in RTL and Delphi Object Pascal
Agreed. XML carries its own encoding information, which any compliant parser must handle. So always pass raw bytes into an XML parser and let it work out the encoding, don't decode the bytes yourself. -
Is Raymond Chen's word not proof enough for you?
-
THAT'S an important piece of information that was missing. Python4Delphi's MainModule is a function that returns a custom Variant holding a reference to Python's __main__ object. A custom class named TPythonVariantType derived from Delphi's TInvokeableVariantType is used to allow such Variants to access properties and methods of the Python objects they hold. So, in your example, when you call MainModule.ClickElement_ByXPATH, the Delphi compiler emits code to pass the MainModule Variant to Python4Delphi's implementation of TPythonVariantType.DoProcedure() or TPythonVariantType.DoFunction() (depending on whether a return value is used or not) to invoke the "ClickElement_ByXPATH" function by name at runtime. So, to do what you are asking for, you could invoke TPythonVariantType.DoProcedure() manually, eg (UNTESTED!): uses ..., Variants, VarPyth; var custType: TCustomVariantType; v: Variant; begin // MainModule.ClickElement_ByXPATH(); if FindCustomVariantType(VarPython, custType) then begin v := MainModule; custType.DoProcedure(TVarData(v), 'ClickElement_ByXPATH', nil); end; end;
-
How are you calling Python functions from Delphi code to begin with?
-
Are you wanting to call a Python function dynamically from Delphi code? Or call a Delphi function dynamically from Python code? Its not clear what you are looking for. Can you provide an example?
-
Are you the one putting the data on the clipboard to begin with? If so, then why not store the required file size explicitly? If you can't put it in the MIME data itself, you can store it as a second format alongside the MIME data. The clipboard can hold more than one data item at a time.
-
In case anyone is not already aware of this https://quality.embarcadero.com is now in a permanent read-only mode. A new system is being implemented, but has not been opened to the public yet. So, if you do have a legit bug/feature to report, feel free to post it in a public forum, or write to Embarcadero directly, and someone who has internal access to the new system can open tickets for you until the new system is ready for public use.
-
No. Using a share path only works on the local LAN network, and only if the file is exposed by the server to the LAN via a UNC share to begin with. If you want to copy a file over the Internet, you need to setup a suitable TCP server for that, such as an HTTP or FTP server.