delphi

What's going on with these XML nodes named "#text"?

I've got some simple XML-handling code that's supposed to locate a child node of a passed in node based on an attribute value: function GetNodeByAttributeValue( const AParentNode: IXMLNode; const AttributeName: string; AttributeValue: Variant): IXMLNode; var i: integer; value: Variant; begin result := nil; if (not Assigned(A...

Delphi 2007 Visual Component

Hello, I have been making components for Delphi for a couple months now. Currently I am extending the TButton to create another form that has 20 or so components on it. I have done this recently and just created everything dynamically in click event. Is there a way to create to form and have it compiled into the component so I can ...

Delphi: How to implement QueryInterface of IUnknown?

In Delphi, IUnknown is declared as: function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall; Note: The output parameter is untyped In my TInterfacedObject descendant i need to handle QueryInterface, so i can return an object that supports the requested interface: function TFoo.QueryInterface(const IID: TGUID; out Obj): ...

Drawing a non rectangular part of a picture in delphi canvas

Can anyone share a sample code to draw a non-rectangular part of a picture in delphi canvas? ...

TDrawGrid OnSetEditText fires twice + Inplace Editors + TCustomGrid

Hi, I have (in D2010) a TDrawGrid on my form. Im handling my OnDrawCell, OnSetEditText, OnSetEditText etc alls gfine there. If however in the specific situation that you go in a cell that has some text, highlight the text in its entirity, then type some character to replace. Now the OnSetEditText event fires twice in a row from one keyp...

How can I hide Cursor in Windows? (delphi)

I want my program to work sort of like Team Player. Multi mice, multi cursor but only one focus. But the problem is I can't hide the default cursor. I only want it to be invisible. So far this works inside my application only. ShowCursor(false); and Screen.Cursor:=crNone; Is there a way to hide the cursor for the entire system (jus...

Delphi - detecting if my app has a modal dialog open

I have a Delphi 2006 app that pops up a modal alert dialog when an error condition is detected. As the check for the error condition is done in an idle handler, the dialog can pop up over the top of another modal dialog if that one happens to be displayed. This can lead to a confusing situation for the user where the application main f...

Infernal Libraries (aka DLL Hell)

In a Project of mine, I use a Delphi Application which dynamically loads a wrapper DLL (exporting C-Style functions) which in turn is statically link against a bunch of 3rd party DLLs. It works fine on my test machines, but on my customers computer it failed to initialize with an error Message like "Couldn't find entrypoint _somefunctio...

How do I get rid of this? (Looks like the form version of mouse trails)

I have cursor shaped forms (functioning as actual cursors). Whenever I drag it makes what looks like mouse trails. The red and white stuff. See the little red arrow on the upper heart and the little white arrow on the lowest heart? Those are my cursor shaped forms, it's a picture on a tiny form (I cut regions so that the form will be sha...

Get Column names with Delphi (Dbexpress)

Hi , I'm using this sql command to get column names : select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'MyTableName' but i don't know how can i using the executed SQL command results ! for example , this way doesn't work to extract the column names as a string value and i got this error = Operation Not Supporte...

How can I get png image RGBcolors in delphi 2009

I have a cipher encoded as a color series in a png image the image is RGB-colored but the code is ciphered only in the green byte How can I get the RGB colors in this 1x84 pixel image? ...

delphi - calculate directory size API?

hi, Anyone knows other way to get a directoy's size, than calculate it's size by counting file with file? I'm interested on some win32 API function. I've google it about this, but i didn't found relevant information so i'm asking here. Best regards, PS: I know how to calculate a directory size by using findfirst and findnext and sum...

Converting Strings to Hex in a performant way

I developed the following function to convert strings to hex values. function StrToHex(const S: String): String; const HexDigits: array[0..15] of Char = '0123456789ABCDEF'; var I: Integer; P1: PChar; P2: PChar; B: Byte; begin SetLength(Result, Length(S) * 2); P1 := @S[1]; P2 := @Result[1]; for I := 1 to Length(S) do ...

is there a good c/c++ to delphi converter(software)

i need a tool that can convert c/c++ code to delphi(object pascal) code, have tried openc2pas but it is pretty much useless and a pain to use is their a usable alternative?(free or commercial) ...

extending delphi's dbrichedit (TJvRichEdit)

Hi, We are upgrading our application for rich text editing. In the old versions there were just plain text with dbmemo, now there should be some formatting and I want to use the TJvRichEdit for this. The problem: The texts that already exists in the database is plaintext. When I open a mask and don't change anything in the richEdit, it...

delphi new project not starting at form1

So this is just a pet peeve maybe but when I start delphi and start a new project just to test something out I expect it to be form1, unit1, etc. But its starting out new projects at form 2. How can I fix this? I suspected to find a default save space for projects but I did not. I am using delphi 2007 and windows 7. ...

Send an e-mail with rtf text in delphi

I would like to perform the following task: converting a TRichEdit content (an rtf text) into a not-plain-text e-mail message body. MAPI doesn't support rtf, but is there a way to do it maybe with Indy? The problem is that rtf is rtf and emails are plain text or HTML. Can someone suggest a trick? Is it possible to convert rtf to text ...

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

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, fo...

Is there no SERVER NAME Parameter for BDE in Delphi 2010?

We are migrating a pretty big application crafted in Delphi 5 (still getting customers using this old versions) that uses BDE to connect to a SQL Server. The decided path to migrating is first Delphi 5 to Delphi 2010, then BDE to dbExpress (or dbGO, still undecided). The problem is that BDE in Delphi 2010 doen't seems to have SERVER NA...

Is the TTimer.OnTimer event handler reentrant?

I have a TTimer in my application that fires every 2 seconds and calls my event handler, HandleTimerEvent(). The HandleTimerEvent() function modifies shared resources and can take 10's of seconds to execute before returning. Furthermore, I call Sleep() in the event handler to relinquish the processor at times. I'm not sure how C++ build...