delphi-xe2

EXE Size is too big in Delphi XE2

雨燕双飞 提交于 2019-12-17 20:24:46
问题 I have created a simple project in Delphi XE2 with only 3 or 4 delphi forms which are only 8 or 9 KB in size. But If I see the exe size, its 12MB. I don't know how? What could be the reasons? 回答1: You're using the default Debug build configuration, which includes debug information in the exe. You normally change the build configuration to release in order to produce a smaller exe for distribution, at the expense to lose the ability to debug it within the Delphi IDE (step by step). Take a look

Enumerate TWebRequest HTTP header fields

Deadly 提交于 2019-12-17 20:13:08
问题 is it possible to dump all the header fields of a TWebRequest (and TWebResponse) object? At the moment I use GetFieldByName() and print them with Writeln() but this works only if I already know the name of the header field. I'm looking for a way to obtain all header field names to enumarate each field but I didn't find any method to do that. I wrote a REST datasnap console application and wants to log all HTTP requests/responses to console. 回答1: AFAIK it is not possibile (Delphi XE2). I've

How can I increase the size of the string that an external debugger visualizer can display?

断了今生、忘了曾经 提交于 2019-12-17 19:34:25
问题 I am once again writing an external debugger visualizer, and am running into a wall. There appears to be a limit to the size of the string that the debugger visualizer can return. The TStrings debugger visualizer that shipped with Delphi 2010 had a limit of 4K. In a response to a question posted on Embarcadero's newsgroups, Ewe Schuster replied that "You can increase the buffer a little bit, but AFAIR the actual limitation is in IOTAThread.Evaluate with a limit of about 12k chars." My

How I can patch a private method of a delphi class?

我与影子孤独终老i 提交于 2019-12-17 18:37:25
问题 I have read these questions and answers How to change the implementation (detour) of an externally declared function Patch routine call in delphi but i can't figere out how patch a private method of a class located in anoher unit. Check this sample I want to patch the Bar procedure. Unit ThidParty; Interface Type TFoo =Class private procedure Bar; end; I think which the key is find a way to obtain the address of the private method. So, How I can patch a private method of a delphi class? 回答1:

Reduce exe file

馋奶兔 提交于 2019-12-17 17:32:13
问题 Using Delphi (or in general any tools, if exist of course), is it possible to reduce size of an exe file, removing all code that not is used but that is present there? (for example, a function or procedure that is present but is never called). I remember that with Pascal, using unit (without objects) the compiler includes only procedures and functions that are really used and will strip out non-used routines in a unit from the final exe. With Object-pascal, I remember that in Delphi 1 all

Delphi XE2 listview artifacts

杀马特。学长 韩版系。学妹 提交于 2019-12-17 16:57:09
问题 I am using listview in vsreport virtual mode, have two columns and after I populate the list, select one row, and then select some other row there's an artifact left on a previously selected row, see image below. How to fix this? and this is my code that gets the data from an array procedure TForm1.ListView1Data(Sender: TObject; Item: TListItem); begin Item.Caption := FloatToStr(Item.Index + 1); Item.SubItems.Add(FloatToStr(a[Item.Index])); end; When I hover the mouse, the artifacts dissapear

Generics not resolving method types correctly

拜拜、爱过 提交于 2019-12-17 16:55:21
问题 Consider the following : {$APPTYPE CONSOLE} uses Generics.Collections; type TObjProc = procedure of object; TFoo = class public procedure DoFoo; public procedure DoBar; end; procedure TFoo.DoFoo; begin WriteLn('foo'); end; procedure TFoo.DoBar; begin WriteLn('bar'); end; var ProcList : TList<TObjProc>; Foo : TFoo; aProc : TObjProc; begin Foo := TFoo.Create; ProcList := TList<TObjProc>.Create; ProcList.Add(Foo.DoFoo); ProcList.Add(Foo.DoBar); for aProc in ProcList do aProc; ReadLn; end. This

MDI window title in Windows 10

十年热恋 提交于 2019-12-17 16:49:10
问题 I'm testing Delphi applications on Windows 10 and I was intrigued a difference in rendering the window frames on MDI forms. It is the intention? 回答1: I presume you are talking about the minimise, maximise and close buttons at the right hand end of the caption bar. These buttons are rendered by the system rather than Delphi and the behaviour is as designed. Microsoft deprecated MDI at least 15 years ago and so it's not at all surprising that they have not modified it to match the new style of

Delphi XE2: Is it possible to create Mac GUI applications without FireMonkey?

北城余情 提交于 2019-12-17 15:55:15
问题 Using Delphi XE2, is it possible to create a Mac GUI application without using FireMonkey for the GUI? If so, what could be used and how would one go about it? 回答1: In principle, it is possible. But you'd need to translate the Objective-C headers and classes exposed by Apple. That is a huge task, part of which has already been done by the FreePascal people or the Objective-Pascal people. But nothing prevents you from translating the (missing) headers yourself. You can call methods of a class

HTML Tag Parsing

冷暖自知 提交于 2019-12-17 15:35:43
问题 How can I parse Name: & Value text from within the tag with DIHtmlParser? I tried doing it with TCLHtmlParser from Clever Components but it failed. Second question is can DIHtmlParser parse individual tags for example loop through its sub tags. Its a total nightmare for such a simple problem. <div class="tvRow tvFirst hasLabel tvFirst" title="example1"> <label class="tvLabel">Name:</label> <span class="tvValue">Value</span> <div class="clear"></div></div> <div class="tvRow tvFirst hasLabel