delphi-2009

Enumerating published properties and subproperties in Delphi

我只是一个虾纸丫 提交于 2019-12-14 01:40:57
问题 Apologies if the question was asked before. I have some definition of some components as follows (please guide me if it's wrong, because I'm a beginner). What I am trying, is to enumerate all published properties of the derived components, particularly the sub-properties. I am able to enumerate the names of the properties, however, is it possible to enumerate the published properties for which I can access the elements (as in the sub-properties) during the execution of the program? something

Is sqrt still slow in Delphi 2009?

会有一股神秘感。 提交于 2019-12-13 13:24:24
问题 Is sqrt still slow in Delphi 2009? Are the old tricks (lookup table, approx functions) still useful? 回答1: If you are dealing with a small set of really large numbers then a lookup table will most always be faster. While if you are dealing with a large set of small numbers then even a slow routine may be faster then maintaining a large table. I looked in System.pas (where SQRT is located) and while there are a number of blocks marked as licensed from the Fastcode project , SQRT is not. In fact

Delphi TWebBrowser Memory Leak

断了今生、忘了曾经 提交于 2019-12-13 12:12:22
问题 My application uses a TWebBrowser that loads a webpage. The problem is, after closing the form containing the TWebBrowser, the memory used is not freed. If I open and close the form, the memory just keeps on increasing. Saw some post regarding calling SetProcessWorkingSetSize() or CoFreeUnusedLibrariesEx() to solve this issue, but I'm not sure if any of these are the correct solution. Any idea how to free the memory used by TWebBrowser? 回答1: QC#106829 describes one possible cause of memory

File is Still in Use Error 32 How can I free it?

我的梦境 提交于 2019-12-12 17:06:47
问题 I am uploading a file via the following code. After a successful upload I am attempting to Delete the file but I am getting a 32 - File in use error. Can anyone tell me how I can resolve this file in use error? The following code is uploading the file, but not releasing it when done.. var HTTP: TidHTTP; SSLIOHandler: TIdSSLIOHandlerSocketOpenSSL; PostData: TIdMultiPartFormDataStream; ResponseStream: TStringStream; Delete : Boolean; begin ResponseStream := TStringStream.Create(''); HTTP :=

How to check if a file has Alternate Data Streams?

江枫思渺然 提交于 2019-12-12 15:29:24
问题 Is there a way in Delphi to check if a file has any Alternate Data Streams? 回答1: Have a look at the Win32 API FindFirstStreamW() and FindNextStreamW() functions: Enumerates the first stream with a ::$DATA stream type in the specified file or directory. Continues a stream search started by a previous call to the FindFirstStreamW function. However, a file or directory may have other stream types besides ::$DATA , which are not enumerable in the Win32 API, they are internal to NTFS itself. See

delphi translation tool [closed]

99封情书 提交于 2019-12-12 15:06:57
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 8 years ago . I am looking for translation tools other than the features that come already with Delphi 2009. I tried dxGetText, and the wischnewski.tv tool. I had

How to modify TComponentProperty to show only particular items on drop down list?

不问归期 提交于 2019-12-12 12:25:32
问题 Please consider such scenerio: I have component called TMenuItemSelector which has two published properties: PopupMenu - allows to pick an instance of TPopupMenu from the form and MenuItem which allows to pick any instance of TMenuItem from the form. I would like to modify property editor for MenuItem property in a way that when PopupMenu is assigned then only menu items from this PopupMenu are visible in a drop down list. I know that I need to write my own descendant of TComponentProperty

How to get the file URL from absolute path in Delphi?

主宰稳场 提交于 2019-12-12 11:14:18
问题 I'm looking for a Delphi function which returns the file URL path from the Windows path. Is there something for it built-in in Delphi ? Example: Input C:\Users\Documents\File.txt Output file:///C:/Users/Documents/File.txt Thanks 回答1: You can use the UrlCreateFromPath API function. Here is the example: uses ComObj, WinInet, ShLwApi; function FilePathToURL(const FilePath: string): string; var BufferLen: DWORD; begin BufferLen := INTERNET_MAX_URL_LENGTH; SetLength(Result, BufferLen); OleCheck

Custom sort order for dataset after executing query?

醉酒当歌 提交于 2019-12-12 10:42:43
问题 I want the result set of a database query to have a certain order. The information I want to order by is not contained in the database, but dynamically generated in code (so I cannot use ORDER BY ). Is there a way to sort a dataset after executing the database query? (I don't need indexed access but only want to iterate over all records.) 回答1: There is a possibility that shares similarities with Jens' answer (+1) but gets to the result in a slightly different fashion. Given an existing table:

Delphi 2009 ShellTreeView/ShellListView Fix

拥有回忆 提交于 2019-12-12 09:46:48
问题 When a Delphi 2009 project is closed with ShellTreeView/ShellListView on the mainform in the IDE Index out of bounds(0) exceptions are generated. Is there a fix for ShellTreeView/ShellListView so the exceptions can be eliminated? 回答1: That's the first I've heard of this. If it's any consolation I can reproduce it here. The first thing you should do is probably file a bug report in Quality Central, and ask on the Codegear NNTP Newsgroups. Also, try changing TCustomShellListView.GetFolder to