delphi-2010

How can I extract an image of a specific size from an icon?

£可爱£侵袭症+ 提交于 2019-12-18 03:37:30
问题 How can I extract an image of a specific size or all images from an icon with multiple images? 回答1: You don't say what the purpose of this is, and there are a number of ways of getting icons and one method may be better than another depending on the purpose. However, to extract any number of "large" (32x32) and/or "small" (16x16) icons* from an arbitrary file , use the ExtractIconEx function. This lets you extract one or more icons of either of these two standard sizes from an icon file (.ico

When a class implements a descendant interface, why doesn't it automatically count as implementing the base interface?

别来无恙 提交于 2019-12-18 03:08:48
问题 What's the reason this won't compile? type IInterfaceA = interface ['{44F93616-0161-4912-9D63-3E8AA140CA0D}'] procedure DoA; end; IInterfaceB = interface(IInterfaceA) ['{80CB6D35-E12F-462A-AAA9-E7C0F6FE0982}'] procedure DoB; end; TImplementsAB = class(TSingletonImplementation, IInterfaceB) procedure DoA; procedure DoB; end; var ImplementsAB: TImplementsAB; InterfaceA: IInterfaceA; InterfaceB: IInterfaceB; begin ImplementsAB := TImplementsAB.Create; InterfaceA := ImplementsAB; >> incompatible

What is a safe Maximum Stack Size or How to measure use of stack?

回眸只為那壹抹淺笑 提交于 2019-12-18 02:48:53
问题 I have an app with a number of worker threads, one for each core. On a modern 8 core machine, I have 8 of these threads. My app loads a lot of plugins, which also have their own worker threads. Because the app uses huge blocks of memory (photos, eg. 200 MB) I have memory fragmentation problem. The problem is that every thread allocates the {$MAXSTACKSIZE ...} of address space. It's not using the physical memory but the adress space. I reduced the MAXSTACKSIZE from 1MB to 128KB and it seems to

How can I fix “Cannot open clipboard: Access Denied” errors?

最后都变了- 提交于 2019-12-17 23:25:56
问题 I am using the following code to copy text to the clipboard: Clipboard.Open; try Clipboard.AsText := GenerateClipboardText; finally Clipboard.Close; end; Seemingly at random I get "Cannot open clipboard: Access Denied" errors. I'm guessing that these errors are caused by other application locking the clipboard, but I never seem to be doing anything with other applications that should cause the locks. Strangely my users seem to be reporting more of the errors with Vista and Windows 7 than with

Method pointer and regular procedure incompatible

妖精的绣舞 提交于 2019-12-17 22:42:48
问题 I have an app, which has multiple forms. All these forms have a PopupMenu. I build the menu items programatically, all under a common root menu item. I want ALL the menu items to call the same procedure, and the menu item itself is basically acting as an argument.... I had this working when I just had one form doing this functionality. I now have multiple forms needing to do this. I am moving all my code to a common unit. Example. Form A has PopupMenu 1. When clicked, call code in Unit

Secure way to store password in Windows

倾然丶 夕夏残阳落幕 提交于 2019-12-17 22:24:15
问题 I'm trying to protect a local database that contains sensitive info (similar to this question, only for delphi 2010 ) I'm using DISQLite component, which does support AES encryption, but I still need to protect this password I use to decrypt & read the database. My initial idea was to generate a random password, store it using something like DPAPI ( CryptProtectData and CryptUnprotectData functions found in Crypt32.dll), but I couldn't find any example on that for Delphi My question is: how

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 to install a component from .pas file in delphi?

試著忘記壹切 提交于 2019-12-17 19:26:12
问题 i've downloaded the RealTimeMarquee component for embarcadereo delphi 2010 which comes as a two files RealTimeMarquee.pas SimpleHTML.pas But when i tried to open the file using delphi to compile it, i can't see the green button ( compile / build ) activated. My question: How to install this component. thankyou 回答1: My question: How to install this component. To install follow the steps below (same steps as Remy Lebeau-answer ) Step #1 . make a new package - Step #2 . Select New package Step

Is there a Boyer-Moore string search and fast search and replace function and fast string count for Delphi 2010 String (UnicodeString) out there?

岁酱吖の 提交于 2019-12-17 17:32:18
问题 I need three fast-on-large-strings functions: fast search, fast search and replace, and fast count of substrings in a string. I have run into Boyer-Moore string searches in C++ and Python, but the only Delphi Boyer-Moore algorithm used to implement fast search and replace that I have found is part of the FastStrings by Peter Morris, formerly of DroopyEyes software, and his website and email are no longer working. I have already ported FastStrings forward to work great for AnsiStrings in

Proxy server using Indy

让人想犯罪 __ 提交于 2019-12-17 15:57:11
问题 I'm new to Indy and I want to build a simple proxy-server with it. This is a quite big library, and I just don't know where to start. When client connects to server, OnExucute fires up and receives client connection as parameter (AContext.Connection). I want to do following: [client connection] := AContext.Connection read host/port from [client connection] [remote connection] := connect to host/port while both connections alive: if data available in [client connection]: read data from [client