delphi-2009

Adding or inserting an item to a TListView always adds it to the end when GroupView is Active

自古美人都是妖i 提交于 2019-12-23 13:07:01
问题 In Delphi 2009 : When TListView's GroupView is Active, adding or inserting an item to a TListView always adds it to the end of the list, regardless of Index specified as param. When GroupView is set to false it adds it at the specified index. But when it is true, this behavior is not seen. ListView2.Items.Insert(1) The above should insert item at the sepecified index "1", but always adds it to the end of the list. What am I doing wrong here? object ListView2: TListView Left = 32 Top = 40

Random “Printer selected is not valid” errors on Win2K8R2

别等时光非礼了梦想. 提交于 2019-12-23 12:56:22
问题 I recently changed the printing code for automated printing to a TPrinter based solution. (The old solution, writing text directly to the printer network device worked without errors for many years.) The application is written in Delphi 2009 Enterprise and runs continuously in a user session (not as a service). In regular intervals, the application scans a database for new documents, creates the text to be printed, and sends it to a printer. Before printing, the code sets the printer index:

How to auto expand all TTreeView nodes?

我怕爱的太早我们不能终老 提交于 2019-12-23 09:36:24
问题 I want to expand tree on main form when application starts. How i can do it? I cant find corresponding property. C++ builder 2009. 回答1: You simply need to call FullExpand() on the tree view. 回答2: When adding treenode make its expanded property to true you will find a property for the treeNode Object, set it yo true before add to list of nodes. and also you can find a method for the treeView called ExpandAll My Regards try this code //this will expand all nodes of Level and their parents

How to pass the interfaced object to the Pascal Script function call?

两盒软妹~` 提交于 2019-12-23 08:36:32
问题 Delphi part: I have a class with the event and from that event I need to call a procedure passing the interfaced object to it. It works fine in Delphi but I have problems with declaring it in Pascal Script. To the background - the IGPGraphics interface is a part of the Delphi GDI+ library and without methods is defined like this: type IGdiplusBase = interface ['{24A5D3F5-4A9B-42A2-9F60-20825E2740F5}'] IGPGraphics = interface(IGdiPlusBase) ['{57F85BA4-CB01-4466-8441-948D03588F54}'] The

How to pass the interfaced object to the Pascal Script function call?

一曲冷凌霜 提交于 2019-12-23 08:36:05
问题 Delphi part: I have a class with the event and from that event I need to call a procedure passing the interfaced object to it. It works fine in Delphi but I have problems with declaring it in Pascal Script. To the background - the IGPGraphics interface is a part of the Delphi GDI+ library and without methods is defined like this: type IGdiplusBase = interface ['{24A5D3F5-4A9B-42A2-9F60-20825E2740F5}'] IGPGraphics = interface(IGdiPlusBase) ['{57F85BA4-CB01-4466-8441-948D03588F54}'] The

Automatically Hide or Close PopUp Menu when Mouse Pointer is outside it - Delphi

纵然是瞬间 提交于 2019-12-23 05:18:00
问题 I have a PopupMenu in my Application which pops up when a user right clicks on my App's Notification Area icon. When I right click on this icon, pop up the menu, and do nothing, my App behaves like resuming its work because it looks like it is waiting until I click on a Menu Item. I want to remove this behavior. I tried fixing the PopupMenu by adding an Auto-Close procedure when no response comes from the user and when the Mouse Pointer leaves the PopupMenu. I also tried adding a TTimer that

Delphi TClientSocket replacement using winsock2 and IOCP?

梦想与她 提交于 2019-12-22 18:46:45
问题 Is there such a thing? It needs to be asynchronous (no Indy). 回答1: Try HPScktSrvr - http://www.torry.net/pages.php?id=220#939383 回答2: These may or may not be what you are looking for, but worth a shot: Ararat Synapse - For Delphi 2009 support you need to get the latest from SVN. /n Software's IP*Works - Commercial, but very full featured. Good luck! 回答3: Check http://voipobjects.com/index.php?page=delphi-iocp-library It is migrated iocpclasses.sourceforge.net (i'm an author). Enjoy :) 来源:

Is there a generic “Object Pool” implementation for Delphi?

空扰寡人 提交于 2019-12-22 09:53:57
问题 I came across this while looking for a database connection pool implementation for Delphi. An object pool needs two methods: get - to acquire an object from the pool (this will create a new instance if the pool is empty or its size has not reached its maximum size), this methods must be thread safe so that one object can not be acquired by two threads at the same time. If all objects are iin use, the get method must block (maybe with an optional time out) put - to release (return) an object

What is Codepage 0?

我只是一个虾纸丫 提交于 2019-12-22 09:10:17
问题 I'm using the Delphi function StringCodePage I call it on a string returned by a COM function (Acrobat Annotation getContents - see my other posts) and it returns 0. What is 0? Ansi? 回答1: Code page 0 is CP_ACP, current Windows ANSI code page. From Windows.pas: {$EXTERNALSYM CP_ACP} CP_ACP = 0; { default to ANSI code page } From MSDN: CP_ACP The current system Windows ANSI code page. This value can be different on different computers, even on the same network. It can be changed on the same

Behaviour of TMultiReadExclusiveWriteSynchronizer when promoting read-lock to write-lock

落爺英雄遲暮 提交于 2019-12-22 07:00:06
问题 How can I achieve a synchronization structure like that: Lock.BeginRead try if Changed then begin Lock.BeginWrite; try Update; finally Lock.EndWrite; end; // ... do some other stuff ... end; finally Lock.EndRead; end; without loosing the read lock after the EndWrite, so that no other writers can execute while this code block is executed. How does Delphi 2009's TMuliReadExclusiveWriteSynchronizer behave in this case? 回答1: It seems there are two criteria wrapped up in this question: "without