delphi

Problem with showing some JPG files in Delphi

i have tried to open some JPEG files in Delphi with TImage component. i also added the Jpeg unit. i can open most of jpg files and there is no problem. but when i try to open some JPGs, the program just throw an exception. i also tried to load that images in design mode, but there is some problem. in design mode the exception is: Acc...

How can I find the size of the memory referenced by a pointer?

GetMem allows you to allocate a buffer of arbitrary size. Somewhere, the size information is retained by the memory manager, because you don't need to tell it how big the buffer is when you pass the pointer to FreeMem. Is that information for internal use only, or is there any way to retrieve the size of the buffer pointed to by a poin...

How to call GetEnumerator on arbitrary type?

I'm writing a control that should be able to display any list of data. What I wanted to do, was to mimic the for-in construct in that I check for a public GetEnumerator function that contain a Current property and a MoveNext method. I've determined the following: I can check the existance of a method by simply calling MethodAddress on...

What is wrong with this "StretchKey" implementation?

I'm trying to create a Delphi version of this algorithm: void PWSfileV3::StretchKey(const unsigned char *salt, unsigned long saltLen, const StringX &passkey, unsigned int N, unsigned char *Ptag) { /* * P' is the "stretched key" of the user's passphrase and the SALT, as defined ...

How to update the text in a tray icon balloon by hand?

I use CoolTrayIcon component,but I can modify it by hand.What I want to accomplish is to update the text in the balloon i just created without actually creating another balloon.Problem is: function TCoolTrayIcon.ShowBalloonHint(Title: String; Text: String; IconType: TBalloonHintIcon; TimeoutSecs: TBalloonHintTimeOut): Boolean; // Show...

How to add Other Application in Project?

Hello All Friends......... How to add Other Application in Project? ...

Error on setting TDateTimePicker.Font.Style to italic in Delphi 5

Is it possible to set TDateTimePicker’s font to italic? I am doing it in this code var DatEdit : TDateTimePicker; begin //I know Canvas is a stupid name for TPanel DatEdit:=TDateTimePicker.Create(Canvas); DatEdit.OnEnter := CtrlInputProc; DatEdit.OnExit := CtrlExitProc; DatEdit.Enabled := false; DatEdit.Font.Style := DatE...

Delphi apps, form size varies on different machines

I've got a Delphi 7 app, on the WinXP development machine the form size is the same as it was designed. However, running the app on a Vista machine, some forms have been enlarged 20-30%, leaving big blank spaces on the right and bottom edge of forms. On one of our client's WinXP machine, the forms have shrink, causing scroll bars to sh...

mathematical expression parser in Delphi?

Duplicate Best algorithm for evaluating a mathematical expression? Is there a built-in Delphi function which would convert a string such as '2*x+power(x,2)' or any equation to float? StrToFloat raises an exception because of the char X and power. Thanks. ...

Delphi, evaluate formula string

Duplicate Best algorithm for evaluating a mathematical expression? mathematical expression parser in Delphi? I need a program in Delphi that get one variable equation from Edit1 such as "F(x)=4*X+2*log(x)+4*power(X,2)"and get X value variable from Edit2 then show the result F(X) in Edit3. Please help me. Thanks. ...

Delphi 2007 WSDL Import, setting SOAP header information

Importing WDSL in Delphi 2007 works fine, but generates a Cannot Unwrap warning (code snippet 1, below [like another question already logged on StackOverFlow]). However, it is how we set the headers (REQUESTOR:pIn, REQUEST_USER:pIn, REQUEST_PASSWORD:pIn) that is unclear from the generated code. Looking elsewhere on the Net, we also tri...

How do I make a TLabel behave like a hyperlink in Delphi?

How do I make a TLabel behave like a hyperlink in Delphi? Note: I'm not interested in using TLinkLabel because of backwards compatibility issues. ...

Firebird aliases

I have developed an application using Delphi and Firebird 1.5, where the server is located on the same machine as the application. I am now deploying the application to another site, where the Firebird server (Superserver) is running on one machine (NT4) whilst the client is running on another machine. The application can connect to th...

Delphi debugger showing ???? for Currency variables

I'm trying to see the value of a variable, but the debugger shows me a value of "????". This seems to happen to Currency variables, but not other types (Double and enumerated types are ok). I'm debugging on Windows XP SP 3 using Delphi 10 Update 2. The process I'm using is: Build the project in the BDS IDE. Copy the exe to the direct...

zlib directories (saving paths)

Hello, I have tried quite a few codes but none of them seem to work the way I want. How do I zlib (no compression required, just adding all files to data chunk would be ok) all files and sub directories in folder (but not folder itself) while saving all paths, so it would extract them to all the correct paths instead of dumping everyth...

assigning a value to a global variable (Delphi)

I am trying to access a global variable on a form that is one in an Array of Forms, I have tried using this: max_forms := 3 setlength(form_array, max_forms); form_array[1] := frm1; form_array[2] := frm2; if current_form > 0 then begin form_array[current_form].fNumber := Number; form_array[current_form].ShowModal; end; The above...

How to put a transparent color on a form?

I have a form with an image as the background. Now I need to put several transparent dark color areas in several areas off the form. I need not to hide the background. How can I do this? ...

How to stop a dialogs default and cancel behaviour when editing a TTreeView node

I have a dialog with a TTreeView control on it and an OK and Cancel button. The buttons have the Default and Canel properties set to true respectivly and the ModalResult has been set correctly. The user is able to edit the captions of the tree nodes using the controls built in functionality. If the user hits escape or enter while edit...

Delphi array elements alphanumeric sort order?

Is the best way to sort an array in Delphi is "alphanumeric". I found this comment in an old code of my application " The elements of this array must be in ascending, alphanumeric sort order." If so ,what copuld be the reason? -Vas ...

Performance impact of gesture recognition in Delphi?

Delphi 2010 reportedly supports gestures for user interaction (mouse or touch interface), primarily through the Windows 7 gesture API. Will supporting gestures inherently incur a major performance hit? In other words, is most of the gesture-related processing due to detection, or response to, the gesture? By "response to", I mean the ...