delphi-xe2

Can one get/set class-level members using Enhanced RTTI in Delphi?

ぐ巨炮叔叔 提交于 2019-12-24 13:10:59
问题 Preface, it seems i failed to say it clear. I want to enumerate, read and set, all the class var or class properties of a given TClass variable. There is no problem in finding TClass - it is passed. There is no problem in filtering by presence of given attribute. There problem is that RTTI just misses the way to enumerate class fields rather than instance fields. I wanted to make a declarative DLL Loader. Since the DLLs are process-global in windows (you cannot load the same DLL twice) it

Divide work, assign task to an array of threads

做~自己de王妃 提交于 2019-12-24 10:48:12
问题 I need to do math calculations for a text in a memo. [Size of the file: ~2mb] A fitting example would be an encoded text that I need to decode. I pass the memo text to a string in order to decode it. I guess it would be way faster to run my decode function using threads. But after some googling I didn't find a good example fitting my purpose. Example function: function entr_base_N(my_text:String):String; var ts_hamil64:Integer; begin For ts_hamil64 := 1 to Length(my_text) do begin Result:=

Cookie Expired Indy

烂漫一生 提交于 2019-12-24 09:13:08
问题 Recently i found that i am getting EConvertError after calling IDHTTP.GET . I analyzed the traffic and saw the expire date on the cookie is 2000. Now my question is how to bypass this. I am using the Indy10 that is present in XE3. I know Indy follows strict standard about cookie handling but shouldn't there be a feature to turn this off ? URL: https://graph.facebook.com/me?access_token=ACCESS_TOKEN StackTrace: :75a5c41f KERNELBASE.RaiseException + 0x58 System.SysUtils.ConvertErrorFmt($412994,

Delphi Xe2 Package x64

丶灬走出姿态 提交于 2019-12-24 08:48:59
问题 Let's admit, I create new package in Delphi Xe2. I keep under a name "My". I add a simple component "MyComponent". I compile, I receive file Bpl in C:\Users\Public\Documents\RAD Studio\9.0\Bpl\My.bpl. I add a platform "Win x64". I compile, I receive C:\Users\Public\Documents\RAD Studio\9.0\Bpl\Win64\My.bpl. ...\Bpl\Win64\My.bpl to establish as new package does not give, writes "is not windows x32 applications". The first is established normally and on a palette the component appears

Windows XP/7 copy FILE hook

…衆ロ難τιáo~ 提交于 2019-12-24 05:46:21
问题 There's a possibility to hook folder modification operations(copy, delete, rename and so forth), but unfortunately I need hook those operations applied to files. Any thoughts? Environment: Delphi XE2, Windows XP/7/2008 Thanks. 回答1: I know two options 1) You can hook the WinAPi functions like CopyFile and CopyFileEx creating a system wide hook, wrtting the hook yourself or using a API hook library like madCodeHook or Deviare API hook (I've used both libraries with great results.) 2) Writting a

Calling TEdit objects based on DB query

血红的双手。 提交于 2019-12-24 04:49:04
问题 I have a form with 7 TEdit having name EditPhone1, EditPhone2 and so on. In the same form I query a DB to get data to fill those TEdits. Of course I cannot know in advance how many results the query will return. How can I call the various TEdit objects when looping on the rowcount of the query? 回答1: Use FindComponent to "convert" a component name to the component itself: var Edit: TEdit; I: Integer; begin DataSet.First; I := 1; while not DataSet.Eof do begin Edit := TEdit(FindComponent(Format

Is there a limit to DecodeBase64 from EncdDecd?

送分小仙女□ 提交于 2019-12-24 03:09:01
问题 Is there a limit on how large of a Base64 string you can pass in? I'm using the following and when my image gets created it's missing a portion of the bottom. I see that BufferLen is ~44000 and yet DecodeBase64 returns about an array of about 24000 items. BufferLen := (Length(JVal) * 4) div 3; SetLength(PtrB, BufferLen); PtrB := DecodeBase64(AnsiString(JVal)); JStream := TStringStream.Create(PtrB); Jpeg := TJPEGImage.Create; Jpeg.LoadFromStream(JStream); Self.JPG := Jpeg; 回答1: There is no

Is there a limit to DecodeBase64 from EncdDecd?

拥有回忆 提交于 2019-12-24 03:08:01
问题 Is there a limit on how large of a Base64 string you can pass in? I'm using the following and when my image gets created it's missing a portion of the bottom. I see that BufferLen is ~44000 and yet DecodeBase64 returns about an array of about 24000 items. BufferLen := (Length(JVal) * 4) div 3; SetLength(PtrB, BufferLen); PtrB := DecodeBase64(AnsiString(JVal)); JStream := TStringStream.Create(PtrB); Jpeg := TJPEGImage.Create; Jpeg.LoadFromStream(JStream); Self.JPG := Jpeg; 回答1: There is no

Combo box - typing selection then clicking out of focus - doesn't select the typed item

时光总嘲笑我的痴心妄想 提交于 2019-12-24 02:59:13
问题 I'm having an issue with the combo box. I have an event handler for OnClick which refreshes data based on what item was selected. The problem is when this scenario occurs: Drop-down the combo box to list the various options Type on the keyboard to find a matching item Combo box changes this selection and calls the OnClick event My screen refreshes due to this selection / event Click somewhere outside of the combo box to take the focus away from it Combo box goes back to the previous selection

Delphi XE2: Encounter “Error Reading Form” when opening a project in IDE

你。 提交于 2019-12-24 02:42:27
问题 I attempt to upgrade a project group containing 200 projects from Delphi XE to Delphi XE2. Some of the IDE design components aren't install on Delphi XE2 IDE yet. I encounter error when open some projects in Delphi XE2 IDE: "Error Reading Form: Class TSynEdit not found. Ignore the error and continue? Note: Ignoring the error may cause components to be deleted or property values to be lost". This is due to TSynEdit component is not install in the Delphi XE2 IDE. I am in the stage of upgrading