Delphi

PostgreSQL 9.X bytea representation in 'hex' or 'escape' for thumbnail images

北城以北 提交于 2020-01-03 16:37:06
问题 My application (developed in Delphi and ZEOS components) uses PostgreSQL 8.4 and stores some thumbnail images into a bytea column. I want to migrate to PostgreSQL 9.2 and have restored the dump and everything works fine except when I try to retrieve those images: Postgres 9.2 uses hex for output representation instead of escape used in Postgres 8.4. There are two possible solutions: Change the Postgres 9.2 settings for escape representation or change the hex string in binary data via

EnumerateTraceGuids returns “The parameter is incorrect” (87)

懵懂的女人 提交于 2020-01-03 15:42:20
问题 i am trying to call the Windows API function EnumerateTraceGuids: ULONG EnumerateTraceGuids( __inout PTRACE_GUID_PROPERTIES *GuidPropertiesArray, __in ULONG PropertyArrayCount, __out PULONG GuidCount ); Starting from the code sample on MSDN: ULONG status = ERROR_SUCCESS; PTRACE_GUID_PROPERTIES *pProviders = NULL; ULONG RegisteredProviderCount = 0; ULONG ProviderCount = 0; pProviders = (PTRACE_GUID_PROPERTIES *) malloc(sizeof(PTRACE_GUID_PROPERTIES)); status = EnumerateTraceGuids(pProviders,

How is it possible to manually execute the “OnCalcFields” event?

两盒软妹~` 提交于 2020-01-03 15:36:16
问题 Say that I temporarily want to disable the OnCalcFields event (eg. by setting cdsCalcFields := nil ) during a time-consuming operation on a TClientDataSet. How can I tell the TClientDataSet to perform a recalculation of the calculated fields when I re-attach the OnCalcFields method? Another situation that might require a manual recalculation is the situation where some of the calculated fields are depending on other datasets (eg. a calculated field is used to temporarily hold some aggregated

Why does a TToolBar calculate button widths automatically when ShowCaption is set True?

我与影子孤独终老i 提交于 2020-01-03 15:25:07
问题 I need to have two TToolBar s on the right side of my main form, so I put three TPanel s for alignment, and then put the TToolBar s inside them. I've been trying to tell the toolbutton s to have the same width for the past day, to no avail. Here's a screen shot of what I've got: I found out that if ShowCaption is set to True , the toolbars calculate the button width automatically. My question is why, and how to disable this? 回答1: Take a look at this approach: Set Autosize to False for all

How should I adapt my code for compatibility between TBytes and TIdBytes?

℡╲_俬逩灬. 提交于 2020-01-03 15:22:29
问题 I am having the same problem as mentioned in "Delphi XE4 Indy compatibility issue between TBytes and TidBytes ", i.e. compatibility issues between TBytes(Delphi RTL) and TIdBytes(Indy) datatypes when compiling with the Delphi XE4. The source of my problem is that the code is not exactly according to Indy's interface and some of functions use TBytes, instead of TIdBytes, when calling native Indy IO procedures. So I was wondering what will the best fix be? As I see it there are two approaches:

what is UPX's best compression method [closed]

流过昼夜 提交于 2020-01-03 15:18:15
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I Have been trying out different EXE packers recently. I tried out ASPack, UPX, mPress etc.. While trying out half a dozen packers, i

How to select all root or all child nodes in VirtualStringTree?

一曲冷凌霜 提交于 2020-01-03 15:15:53
问题 I would like to select either all root nodes or all child nodes (not all nodes in a VirtualTreeView). I've tried to use this code to select all root nodes: procedure SelectAllRoots; var Node: PVirtualNode; begin Form1.VirtualStringTree1.BeginUpdate; Node := Form1.VirtualStringTree1.GetFirst; while True do begin if Node = nil then Break; if not (vsSelected in Node.States) then Node.States := Node.States + [vsSelected]; Node := Form1.VirtualStringTree1.GetNext(Node); end; Form1

Pass a mixture of differend enums types in delphi

冷暖自知 提交于 2020-01-03 13:37:11
问题 I need to write a procedure where can pass different enum selections. type TEnumOne = (eOneFlagOne, eOneFlagTwo); TEnumTwo = (eTwoFlagOne, eTwoFlagTwo); The method should take different enums: Process([eOneFlagOne, eTwoFlagTwo]); I'm trying to implement it like this: // does not work! procedure Process(const Enums: array of Variant); var aValue; Variant begin for aValue in Enums do begin // of course, can't work... if aValue is TEnumOne then end; end; So, is there a type instead of Variant, I

Maximum Length of String in Delphi property Lines of TMemo [duplicate]

只谈情不闲聊 提交于 2020-01-03 13:08:14
问题 This question already has an answer here : TMemo max width (1 answer) Closed 5 years ago . I've been searching the reason why the maximum length of String in a TMemo.Lines is 1024, but not found yet. I have a text file which contains delimited / csv data which length is around 2000 characters. I use a memo to preview it before I process the file. memo.Lines.LoadFromFile(textFile); I have set the WordWrap to FALSE, and scrollBar to ssHorizontal. So any record will not be wrapped to the next

Maximum Length of String in Delphi property Lines of TMemo [duplicate]

我是研究僧i 提交于 2020-01-03 13:07:13
问题 This question already has an answer here : TMemo max width (1 answer) Closed 5 years ago . I've been searching the reason why the maximum length of String in a TMemo.Lines is 1024, but not found yet. I have a text file which contains delimited / csv data which length is around 2000 characters. I use a memo to preview it before I process the file. memo.Lines.LoadFromFile(textFile); I have set the WordWrap to FALSE, and scrollBar to ssHorizontal. So any record will not be wrapped to the next