Delphi

Where to save ini file dependent to machine (not user) on windows

↘锁芯ラ 提交于 2020-01-01 11:45:34
问题 My application is currently storing settings in an INI file under the current user's profile ( C:\Documents and Settings\<CurrentUser>\Application Data\MyApplication\MySettings.ini under WinXP). But I've realised some of these settings are unique to the machine not the user and thus want (actually need) to save them in a single location for all users. Is there a folder location on Windows XP (and up) where I can store user independent settings? NOTE: I don't want to store them in the same

Can threads safely read variables set by VCL events?

故事扮演 提交于 2020-01-01 11:42:09
问题 Is it safe for a thread to READ a variable set by a Delphi VCL event? When a user clicks on a VCL TCheckbox, the main thread sets a boolean to the checkbox's Checked state. CheckboxState := CheckBox1.Checked; At any time, a thread reads that variable if CheckBoxState then ... It doesn't matter if the thread "misses" a change to the boolean, because the thread checks the variable in a loop as it does other things. So it will see the state change eventually... Is this safe? Or do I need special

Forcing a non blocking temporary hint window in Delphi

萝らか妹 提交于 2020-01-01 11:39:13
问题 I've been searching, but cannot find a solution so I figured perhaps I should simply post it. Here's what I'd like to do, in Delphi (2009): At a certain moment in my application, I'd like to show a message to the user. This should be the normal hint window, which automatically disappears after the normal application defined hint pause, with a custom message (and have it automatically sized etc etc). This should be non blocking, like a normal hint, not dependent on the current control or

Read GUID value stored in registry

时光总嘲笑我的痴心妄想 提交于 2020-01-01 11:34:07
问题 I try to read a GUID value stored as a binary value in registry in Delphi. When I read it with BintoHex, but the result is in reverse order. It seems that I have to swap bytes but I thought BinToHex would do it. I refered to this thread but I can't find the right solution : how to convert byte array to its hex representation in Delphi It seems that it is due to little Eendian. Below, you can see the GUID stored in registry Here is my code : var s : string; buffer : pointer; ... begin getmem

Stopping delphi program in an infinite loop

拜拜、爱过 提交于 2020-01-01 11:29:33
问题 When an indefinite loop occurs in Delphi, the debugger will not even give me a stack trace when I hit the stop button. If I have a suspicion of where the program is stalling, I can put a breakpoint and it will stop if that is the correct indefinite loop. Here is a sample program to deliberately cause an indefinite loop: procedure TForm1.btnDebugInfiniteLoopClick(Sender: TObject); var I: Integer; begin I:=0; while I<100 do begin I:=1+1; if I>64 then I:=I div 2; end; end; When stopped, I get

Is there some functionality in/for Delphi that converts a string with html named and numbered entities to unicode text?

六眼飞鱼酱① 提交于 2020-01-01 11:26:49
问题 I read data from a mysql database that has is filled by php scripts. All special characters are converted to named or numbered html entities (for example & a m p ; & # 2 8 6 ;). I know of no way to convert these characters back to the original ones in Delphi as unicode strings. Did anyone ever find or even create such a function? This would be very helpful to me. Thanks! Marc 回答1: In Delphi 2007 there is a unit called HTTPApp.pas (in [Delphi Folder]\Source\Win32\Internet) that has the

Delphi Coding Standards [duplicate]

穿精又带淫゛_ 提交于 2020-01-01 10:56:08
问题 This question already has answers here : What Delphi coding standards document(s) do you follow? [closed] (8 answers) Closed 5 years ago . I am in the process of writing (down) our companies coding standards for Delphi programming, so what would anyone suggest to have as a basis, anything that you would recommend to use / not use ? 回答1: I used Delphi Language Coding Standards Document as a basis for an internal document. The Object Pascal Style Guide could probably be termed the "official"

Delphi 2010 Control Flickering

*爱你&永不变心* 提交于 2020-01-01 10:53:57
问题 I have been upgrading or migrating our software from XP OS to be able to compile and run under Windows 7. Our software is starting to show issues that we didn't notice under Windows XP. Currently, I am dealing with a user defined control flickering on a TForm. It seems to flicker every now and then not always, but when it flickers it is very noticeable. I have set DoubleBuffered for the TForm and TTrendChart Class, but it is not helping. This a user-defined control of TCustomPanel. It is

Delphi Android app API level 26?

余生颓废 提交于 2020-01-01 10:17:50
问题 I got my app into Google Play's app store but I also got this warning: Your app currently targets API level 14 and must target at least API level 26 to ensure it is built on the latest APIs optimized for security and performance. From August 2018, new apps must target at least Android 8.0 (API level 26). From November 2018, app updates must target Android 8.0 (API level 26). How do I get Delphi 10.2.3 to "target API level 26"? 回答1: See https://community.embarcadero.com/blogs/entry/deadline

Get internet time in delphi

六眼飞鱼酱① 提交于 2020-01-01 10:17:20
问题 i want to get time and date from internet i used following code IdDayTime1.ReadTimeout := 5000; IdDayTime1.Host := 'www.time.windows.com'; IdDayTime1.Port := 37 ; Label1.Caption := IdDayTime1.DayTimeStr; but i get : socket error # 11004 whats is this and what did i do wrong my internet and other things are ok 回答1: DayTime protocol is not the NTP protocol. DayTime uses port 13, not 37. 37 is used by the Time protocol, which, again, in not the NTP protocol, which uses 123 (UDP). I do not know