A.M. Hoornweg
Members-
Content Count
473 -
Joined
-
Last visited
-
Days Won
9
Everything posted by A.M. Hoornweg
-
Why can't I install this monospaced font in Delphi ?
A.M. Hoornweg replied to A.M. Hoornweg's topic in Delphi IDE and APIs
Currently "Consolas" and "Source Code Pro" are my favorites. -
Hello all, I think I've discovered an anomaly in Delphi string behavior. Consider the following code: procedure TForm1.Test(const Defaultvalue: string; out Resultvalue: string); begin Resultvalue:=AnsiUpperCase(Defaultvalue); ShowMessage(Defaultvalue+'.'+Resultvalue); end; procedure TForm1.Button1Click(Sender: TObject); var s:string; begin s:='default'; Test(s,s); end; The output produces just a dot, which makes no sense to me.
-
Hi Stefan, do you know if that folder is only for domain users? Or are there other scenarios in which that folder is synced between machines?
-
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
Strange, when I first noticed the problem it went away 100% after I replaced string with widestring. But somehow I can't reproduce that anymore. Weird! -
Memory leak in UnicodeString to string conversion
A.M. Hoornweg replied to dkprojektai's topic in OmniThreadLibrary
Library, as in DLL? You really can't pass a "string" from a DLL to an application, except when both projects are configured to use a shared memory manager ("uses sharemem"). -
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
I meant, the allocated memory in a widestring isn't managed by the Delphi heap but by Windows. -
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
There is one thing I don't understand though. In the example below, shouldn't the string which is held by variable S have a reference count of at least 2 when procedure Test is called? One held by S itself, one by Defaultvalue? Normally the compiler should perform a Uniquestring whenever something is written to a string with refcount >1, or? procedure TForm1.Test(Defaultvalue: string; out Resultvalue: string); begin Resultvalue:=AnsiUpperCase(Defaultvalue); ShowMessage(Defaultvalue+'.'+Resultvalue); end; procedure TForm1.Button1Click(Sender: TObject); var s:string; begin s:='default'; Test(s,s); end; -
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
Besides, the problem is not consistent, it only occurs with managed types. For example, it does not occur with WideString. -
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
IMHO the compiler should throw an error if the same parameter is passed multiple times to the method and one of them is an OUT parameter. -
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
Omitting the "const" changes nothing though. Delphi still passes it by reference even though it looks like a value parameter. -
Bug in Delphi string behavior?
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
I suspect that it may do so. The "const" makes no difference. Using "VAR" instead of "OUT" also fixes the issue. I am quite alarmed by this issue because recently, whilst refactoring, I started replacing a lot of "VAR" parameters by "OUT" in order to make it more concise to a reader how the parameters are affected. But now it appears that "OUT" is dangerous if you pass the same parameter multiple times. -
Is the sequence of the units in the map file identical to the sequence in which the initialization sections are processed?
-
Hello all, I'm trying to port an older (Delphi XE) SOAP client application to Delphi Rio. I'm stumbling upon a breaking change in THTTPReqResp, which is used by tHTTPRio. The signature of the event THTTPReqResp.OnBeforePost has changed completely. Formerly the signature was: TBeforePostEvent = procedure (CONST HTTPReqResp: THTTPReqResp; Data: Pointer); My routine does some manipulation of the http headers, for example it calls wininet.HTTPAddRequestHeaders(Data, ...) to allow gzip encoding and wininet.InternetSetOption(Data,....) to accept an invalid/self-signed SSL certificate. The new signature of the event has become: TBeforePostEvent = procedure(const HTTPReqResp: THTTPReqResp; Client: THTTPClient) of object; and now I'm stumped. How can I achieve the same as before? I want to accept gzip encoded data and I want to accept self signed SSL certificates. Kind regards, Arthur
-
THTTPReqResp.OnBeforePost breaking change
A.M. Hoornweg replied to A.M. Hoornweg's topic in Network, Cloud and Web
Thank you, I'll try this! -
THTTPReqResp.OnBeforePost breaking change
A.M. Hoornweg replied to A.M. Hoornweg's topic in Network, Cloud and Web
<bump> any news here? I still haven't got a clue how to achieve this in Delphi Rio. -
Patch a private virtual method
A.M. Hoornweg replied to pyscripter's topic in RTL and Delphi Object Pascal
What I meant specifically is, how do I find out the index of a method in the VMT? -
Patch a private virtual method
A.M. Hoornweg replied to pyscripter's topic in RTL and Delphi Object Pascal
That's very interesting, could you show a small example? -
refactoring Is there a way to get the IDE to generate interface methods
A.M. Hoornweg replied to Larry Hengen's topic in RTL and Delphi Object Pascal
Does this support copying to the clipboard? In Delphi XE it doesn't.- 8 replies
-
- interfaces
- ide
-
(and 1 more)
Tagged with:
-
Has any of you tried using Bluestacks instead? It's an all-in-one Android emulator which emulates an ARM processor. I'm not using it for development but rather for running some Android apps that aren't available on Windows.
-
Hello all, Are there any FB experts here? I could use a little help ... I need to enlarge the size of a Varchar primary key column in a small but populated Firebird table from 25 to 40 characters. Much to my surprise, that isn't trivial at all. There are no foreign keys in other tables pointing to this primary key so really, it should be straightforward, shouldn't it? The table name is "channels" and the primary key column is "paramname", it was originally declared as "varchar(25) character set iso8859_1 not null primary key". So far my trial steps were: (note that I did a commit after each statement) //1-Create a temporary column to hold the original data ALTER TABLE channels add temp_paramname VARCHAR(40) CHARACTER SET ISO8859_1 //2-Copy the data UPDATE channels set temp_paramname=paramname //3-Delete the old column ALTER TABLE channels DROP paramname // 4-Re-create column "paramname". The table has records, so I cannot declare it "not null" or "primary key" at this point ALTER TABLE channels add paramname VARCHAR(40) CHARACTER SET ISO8859_1 //5-Populate it with the original data UPDATE channels set paramname=temp_paramname //6-Now make it primary key - this step fails! alter table channels add primary key (paramname) //7-delete the temp column now... I'd be grateful for any help.
-
Firebird, change length of Varchar Primary key column?
A.M. Hoornweg replied to A.M. Hoornweg's topic in Databases
Thanks a lot Remy, this works indeed! But I needed to perform a commit after each step, else it threw an error. -
Firebird, change length of Varchar Primary key column?
A.M. Hoornweg replied to A.M. Hoornweg's topic in Databases
Thanks Remy, I'll give it a try and keey you updated! -
Firebird, change length of Varchar Primary key column?
A.M. Hoornweg replied to A.M. Hoornweg's topic in Databases
Hi Dany, the error message said that FB couldn't create the primary key because the column wasn't declared as "not null". Which I couldn't do, because the new column contains nulls right after creation in step 4. I did the steps one by one in FlameRobin, but when everything works I must re-code it either in Delphi or in InnoSetup (because I have to distribute it as part of a software update). -
The Embarcadero GetIt server could not be reached...
A.M. Hoornweg replied to PeterPanettone's topic in Delphi IDE and APIs
Downloading Android SDK through Getit seems to work now! -
64-bit type libraries still not supported by the IDE ?
A.M. Hoornweg posted a topic in Delphi IDE and APIs
Hello all, Delphi supports 64-bit development since XE2. But somehow it is still not possible to list and import 64-bit type libraries ???? Kind regards, Arthur