Delphi

How to set event handlers via new RTTI? [D2010]

*爱你&永不变心* 提交于 2021-02-19 03:18:56
问题 Playing with new RTTI module, I couldn't find a way to set an event handler with the new utilities. Trying something like this: LProp := TRttiContext.Create.GetType(Form1.ClassInfo).AsInstance.GetProperty('OnClick'); LProp.SetValue(Form1, {a TValue!}); SetValue needs a TValue passed but I've yet to find a way to represent a TMethod via a TValue. Any comments? ps. And a side question.. It seems prefixing RTTI variables with "L" is a convention (and a good one IMO, meta code turns into a puzzle

How can I attach the Delphi debugger to 64-bit IIS 7.5?

本小妞迷上赌 提交于 2021-02-18 22:20:46
问题 I'm running Delphi XE on Windows 7 Pro 64 and IIS 7.5, developing an ISAPI application. IIS is configured correctly (including allowing 32-bit code to run in an ISAPI process). The ISAPI process runs properly. In Delphi I'm trying to attach to the ISAPI process running on localHost to step through my ISAPI.dll code: Run->Attach to Process->InetInfo.exe. I've done this a thousand times with Windows XP and IIS 5, but in this new environment I cannot attach to the ISAPI process. I get an error

How does Proxifier work?

扶醉桌前 提交于 2021-02-18 20:53:26
问题 As you know Proxifier is a program that allows network applications that do not support working through proxy servers to operate through an HTTPS or SOCKS. It can handle any transmission from running applications. I want to know how it can do this and how I can write one like that. 回答1: FreeCap is your way to go. It's released under GNU General Public Licence and written in Delphi. 回答2: A socksifier defines a dynamic library with the same functions as the OS socket layer, but defined in such

How to parse this json data in Delphi 10 Seattle?

筅森魡賤 提交于 2021-02-18 19:48:55
问题 I am having trouble parsing this JSON data in Delphi 10 Seattle. I want to get the values from the JSON and show them in TLabel components one by one. I am new to JSON and REST, it would be nice if you provide a working example. { "countrydata":[ { "info":{ "ourid":119, "title":"Pakistan", "code":"PK", "source":"https://thevirustracker.com/pakistan-coronavirus-information-pk" }, "total_cases":5038, "total_recovered":1026, "total_unresolved":0, "total_deaths":86, "total_new_cases_today":27,

How to parse this json data in Delphi 10 Seattle?

老子叫甜甜 提交于 2021-02-18 19:48:42
问题 I am having trouble parsing this JSON data in Delphi 10 Seattle. I want to get the values from the JSON and show them in TLabel components one by one. I am new to JSON and REST, it would be nice if you provide a working example. { "countrydata":[ { "info":{ "ourid":119, "title":"Pakistan", "code":"PK", "source":"https://thevirustracker.com/pakistan-coronavirus-information-pk" }, "total_cases":5038, "total_recovered":1026, "total_unresolved":0, "total_deaths":86, "total_new_cases_today":27,

Delphi multi-threading file write: I/O error 32

不打扰是莪最后的温柔 提交于 2021-02-18 17:49:14
问题 I created a class for writing thread-safe log in a text file using CriticalSection . I am not an expert of CriticalSection and multi-threading programming (...and Delphi), I'm definitely doing something wrong... unit ErrorLog; interface uses Winapi.Windows, System.SysUtils; type TErrorLog = class private FTextFile : TextFile; FLock : TRTLCriticalSection; public constructor Create(const aLogFilename:string); destructor Destroy; override; procedure Write(const ErrorText: string); end;

How to make an edit control in fmx transparent and hide its border?

柔情痞子 提交于 2021-02-18 17:12:42
问题 How can I make an edit control in fmx transparent and at the same time hide the borders of the control, so it will blend into the control in the back? What I am trying to do is to make a small Notes program where, when I double-click a tabitem, it shows an edit control to change the text of the tabitem. 回答1: Right click the edit control (let's say Edit1) and click 'Edit Custom Style'. Expand 'edit1style1'. Click background:TActiveStyleObject. Clear the SourceLookup property. 来源: https:/

How to make an edit control in fmx transparent and hide its border?

我们两清 提交于 2021-02-18 17:11:05
问题 How can I make an edit control in fmx transparent and at the same time hide the borders of the control, so it will blend into the control in the back? What I am trying to do is to make a small Notes program where, when I double-click a tabitem, it shows an edit control to change the text of the tabitem. 回答1: Right click the edit control (let's say Edit1) and click 'Edit Custom Style'. Expand 'edit1style1'. Click background:TActiveStyleObject. Clear the SourceLookup property. 来源: https:/

How to display a table in ShowMessage?

孤街浪徒 提交于 2021-02-18 12:59:31
问题 I am trying to display a table using ShowMessage that looks like this: short | Description for "short" verylongtext | Description for "verylongtext" How do I get two correctly aligned columns like that in a simple message dialog? I tried to align the columns using spaces, but the font of ShowMessage is variable. Then I tried to align them using tab characters, but I do not know how to calculate the proper tab count for each row. Is there a reliable way to calculate the tab count? PS: I would

TOAuth2Authenticator: How do i refresh an expired token?

一曲冷凌霜 提交于 2021-02-18 12:46:55
问题 I must be missing something here! I have been playing around trying to refresh an expired OAUTH2 token using the new ( new to me anyway, coming from delphi xe2 environment) TOAuth2Authenticator, TRESTClient, TRESTRequest, TRESTResponse components I have set the following authenticator properties with the existing known values for ClientID ClientSecret Scope AccessTokenEndPoint AuthorizationEndPoint RedirectionEndPoint AccessToken AccessTokenExpiry RefreshToken and can successful access