[Solved] In a remote thread, how do I call functions whose parameters contain pointers? [closed]

The immediate problem in this code is that you’re storing pointers to the string parameters in your record. Those pointers are addresses in your main process; they are not valid in the target process. You should store those values in fixed-size arrays in your record, just like you’re already doing with the module and function … Read more

[Solved] How to avoid invoking the Popup Menu of a control when Shift+Ctrl-double-clicking it?

Parallels desktop has an alternate way to right click to support a single button mouse. The running VM will only see the right click when this is used. So your Windows VM is currently receiving two right clicks which it passes on to your Delphi VCL Application. Ref: https://kb.parallels.com/en/9151 2 solved How to avoid invoking … Read more

[Solved] How can one verify whether consecutive letters have been entered from the qwerty keyboard in a delphi console application?

Try something like this: function HasThreeConsecutiveLetters(const Str: string): Boolean; const QwertyLetters: array[0..2] of string = ( ‘QWERTYUIOP’, ‘ASDFGHJKL’, ‘ZXCVBNM’ ); var I, J, K: Integer; S: String; begin Result := False; S := AnsiUpperCase(Str); for I := 1 to Length(S) do begin for J := Low(QwertyLetters) to High(QwertyLetters) do begin K := Pos(S[I], QwertyLetters[J]); if … Read more

[Solved] Is = a case sensitive or insensitive comparison of strings in Delphi?

Help tells us: Strings are compared according to the ordinal values that make up the characters that make up the string. ‘A’ and ‘a’ are different symbols, with different ordinal values, so comparison is case-sensitive, of course. There are special functions like CompareText for insensitive comparisons. Note that case-insensitivity is especially emphasized in descriptions. 1 … Read more

[Solved] Please help me with pascal to c# code conversion [closed]

Existing Delphi code translation: public static string ByteToHex(Byte InByte) { char[] Digits = new char[] { ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, }; return string.Concat(Digits[InByte >> 4], Digits[InByte & 0x0F]); } Better implementation (all you want is formatting): public static string ByteToHex(Byte InByte) => InByte.ToString(“X2”); … Read more

[Solved] Delphi 7 Webbrowser – select without value [closed]

TWebBrowser is just a wrapper for the Internet Explorer ActiveX control, so this is really an IE DOM issue, not a Delphi issue. Try setting the select element’s selectedIndex property instead of its value property: WebBrowser1.OleObject.Document.All.Item(‘year’, 0).selectedIndex := 0; The value property is what gets transmitted to the server, but only of there is an … Read more

[Solved] Delphi XE8 Load PDF File

You don’t need all of the jumping-through hoops you’re doing. Windows will find the application associated with PDF files for you. procedure TForm1.Button1Click(Sender: TObject); var s: String; Ret: DWord; begin s := ‘C:\MyFiles\MyFile.pdf’; Ret := ShellExecute(Handle, nil, PChar(s), nil, nil, SW_SHOW); if Ret < 32 then ShowMessage(SysErrorMessage(GetLastError)); end; Note: Normally you should never call a … Read more

[Solved] Why my Thread run after Form creation?

unit AniThread; interface uses Classes, Windows, Controls, Graphics; type TAnimationThread = class(TThread) private { private declarations } FWnd: HWND; FPaintRect: TRect; FbkColor, FfgColor: TColor; FInterval: integer; protected procedure Execute; override; public constructor Create(paintsurface : TWinControl; {Control to paint on } paintrect : TRect; { area for animation bar } bkColor, barcolor : TColor; { colors … Read more

[Solved] All array possibilities

I have taken the first permutation algorithm I found in wikipedia and implemented it in Delphi (2009); I hope that is what you are looking for: type TIntegerArray = array of Integer; procedure Permutation(K: Integer; var A: TIntegerArray); var I, J: Integer; Tmp: Integer; begin for I:= 2 to Length(A) do begin J:= K mod … Read more

[Solved] DBgrid not showing changes and show error when to try update – Insufficient key column information for updating or refreshing [closed]

My guess is that: does not have the recent changes is because the data has not been posted. And cannot be from what I can see. You’re trying to insert and update tuples from two tables, but you fetched only a foreign key of a detail table. Imagine, that you’d like to update this resultset … Read more

[Solved] Access Violation While Calling Form’s Method

In your question you left out a very important piece of the puzzle. You’ve mentioned it in comments, but I repeat it here because it’s the direct trigger of your problem. In comments you said the form is created as follows: with TForm1.Create(Self) do begin try ShowModal; finally Free; end; end; Your problem is that … Read more

[Solved] SetFocus clears edit box

I haven’t seen such basic behaviour of a TEdit Change in many years… In D2009 + Windows 7 64 and tested on XP. I made a simulation work without any trouble. I suspect you have AutoSelect set to True for the message editor. Therefore when focus switches back and forth the editor auto selects all … Read more