delphi-7

Modify a formula from calculating around a circle to around an oval?

…衆ロ難τιáo~ 提交于 2019-12-10 04:33:52
问题 I have this formula in a function below. It's a fairly simple concept, yet this formula took me almost 2 weeks to get perfect. What it does is calculates what point to place an object at a given degree around and distance from a central point. It's useful for manually drawing circles, and also I primarily use it for a needle gauge component of mine. It calculates where to draw the needle. Now I'm trying to figure out how to modify this formula to take ovals or ellipses into account. I did

Delphi “default” keyword with Record types in older Delphi versions

别来无恙 提交于 2019-12-10 04:21:21
问题 I have this code in Delphi Detours library which I'm trying to port: type TInstruction = record Archi: Byte; { CPUX32 or CPUX64 ! } AddrMode: Byte; { Address Mode } Addr: PByte; VirtualAddr: PByte; NextInst: PByte; { Pointer to the Next Instruction } OpCode: Byte; { OpCode Value } OpType: Byte; OpKind: Byte; OpTable: Byte; { tbOneByte,tbTwoByte,... } OperandFlags: Byte; Prefixes: Word; { Sets of Prf_xxx } ... end; var Inst: TInstruction; begin ... Inst := default (TInstruction); // <- Inst

In Delphi 7, can I set up 'Debug' and 'Release' modes?

£可爱£侵袭症+ 提交于 2019-12-10 01:33:40
问题 In most modern IDEs, you can have Debug and Release build configurations, and you can quickly switch between them. In Delphi 7, this does not seem to be possible. I have to go to Project Settings and toggle optimization and all the debug information stuff manually. It would be great if there was a plugin or some such that handled this for me. Does anyone know of one? Any other suggestions? Edit: I can't upgrade to Delphi 2007 or 2009 as we have a large Delphi 7 codebase which would have to be

Anyone has sample code to load an xml using OMNIXML

橙三吉。 提交于 2019-12-09 21:57:50
问题 I am looking for some actual working sample code to read an XML using the plain OmniXml (or OmniXmlUtils) unit. I don't want to use the TOmniXMLWriter class , as explained elsewhere , but want to load an xml file using plain Delphi code. I searched the OmniXml site but the samples there are as good as non-existing. Thanks in advance. 回答1: Some common taks with OmniXML: Loading the document from file or from stream or string xml := CreateXMLDoc xml.Load(FileName); xml.LoadFromStream

How to create simple XML in OmniXML

北战南征 提交于 2019-12-09 13:47:57
问题 i want to create this structure xml <root ver="" file=""> <row> <id></id> <name></name> <surname></surname> <time></time> <old></old> <subject></subject> </row> </root> when i do the main structure i get the data from online database and i want to add it in my xml file how can i create the main structure how can i add a new Row in every update the database made how can i sort the xml, base of the name node Please help Thank you 回答1: You can use create inherited classes which define your xml

Imagelist with alpha blend icons loses Transparency

僤鯓⒐⒋嵵緔 提交于 2019-12-09 12:56:00
问题 Here is (more or less) a related question: Delphi - Populate an imagelist with icons at runtime 'destroys' transparency. I have tested @TOndrej answer. But it seems I need to have visual styles (XP Manifest) enabled for this to work (version 6.0 of Windows common controls will be used - which I don't want right now). I add the Icons at run-time via ExtractIconEx and ImageList_AddIcon . Apparently setting ImageList.Handle to use System Image-List handle, does not require XP Manifest. so even

Send Parameter To CMD

為{幸葍}努か 提交于 2019-12-09 11:08:09
问题 How can i send parameters to CMD? for example send a path and start it from that path? How can i execute CMD commands? Thanks 回答1: To start cmd.exe and immediately execute a command, use the /K flag: procedure TForm1.FormCreate(Sender: TObject); begin ShellExecute(Handle, nil, 'cmd.exe', '/K cd C:\WINDOWS', nil, SW_SHOWNORMAL); end; To run a command in cmd.exe and then immediately close the console window, use the /C flag: procedure TForm1.FormCreate(Sender: TObject); begin ShellExecute

Access violation while the program was idle - not trace information to track down the bug

老子叫甜甜 提交于 2019-12-09 07:25:23
问题 I have a program that just popped up an AV. Until now the Eureka Log could find the source code line that generated the error but now it displays only this: Access violation at address 7E452E4E in module 'USER32.dll'. Read of address 00000015. Call Stack Information: -------------------------------------------------------------------------------------------- |Address |Module |Unit |Class|Procedure/Method |Line | ---------------------------------------------------------------------------------

Multiple form Delphi applications and dialogs

做~自己de王妃 提交于 2019-12-09 07:20:17
问题 I have a Delphi 7 application that has two views of a document (e.g. a WYSIWYG HTML edit might have a WYSIWYG view and a source view - not my real application). They can be opened in separate windows, or docked into tabs in the main window. If I open a modal dialog from one of the separate forms, the main form is brought to the front, and is shown as the selected window in the windows taskbar. Say the main form is the WYSIWYG view, and the source view is poped out. You go to a particular

embedded file into delphi exe application (not as a separate file from the appliaction)

可紊 提交于 2019-12-09 06:45:50
问题 i want to embedded a file (any kind of type) to my exe application and be able to extract in the remote to use it, i know how do it by embedded into resource,but i don't want to place the files in the app directory, i want to store all files (like .rec) into my exe, in c# it is possible to store as text file and then read it by FileStream but in Delphi the resource files is separate from the exe file. is there any solution to do this ? Thanks a lot! 回答1: You should make an .rc file and add