Delphi

Delete element from a static array

吃可爱长大的小学妹 提交于 2020-01-17 05:37:32
问题 I am trying to remove an item from an array. The array is not dynamic! I found many examples on how to do it for the dynamic variant but none for the static. example from delphi: var A: array of integer; begin ... A:=[1,2,3,4]; Delete(A,1,2); //A will become [1,4] ... end; example from another site: type TIntArray = array of Integer; procedure DeleteArrayElement(var AArray: TIntArray; const AIndex: Integer); begin Move(AArray[AIndex + 1], AArray[AIndex], SizeOf(AArray[0]) * (Length(AArray) -

Not able to use canvas function in Delphi 7

本秂侑毒 提交于 2020-01-17 03:55:07
问题 I am beginning to learn GDI graphics in Delphi 7. I am having problems in drawing Ellipses , Text etc. on my Main form. Basically I use this code: Form1.Canvas.TextOut(10,10,'sss'); Is this Canvas Property required to be associated with the Form? I haven't done any thing like that. Help will be appreciated. 回答1: Make sure you put all painting code in the form's OnPaint event handler (documentation). This handler is called whenever the form needs to be repainted. procedure TForm1.FormPaint

Resolve naming conflicts caused by interface inheritance in Delphi

孤者浪人 提交于 2020-01-17 03:43:17
问题 If i have these 3 interfaces unit Interfaces; interface type IA = interface['{86367399-1601-4FDD-89CF-362E762D948E}'] procedure doSomething; end; IB = interface['{070B9364-4A57-4E5A-BBA7-FBF1C6A48C5A}'] procedure doSomething; end; IC =interface(IB)['{DAC8021C-42CB-40EC-A001-466909044EC3}'] procedure doSomething; end; implementation end. How do i resolve naming conficts in a class that implements IA and IC? I have no problem with IA and IC but how do i implement IB? type myClass = class

Delphi XE6 on Windows 7 64bit, FireDAC cannot find libmysql.dll

不问归期 提交于 2020-01-17 03:25:45
问题 I have a little different question from Delphi XE5 FireDAC Error: Cannot load vendor library libmysql.dll or libmysqld.dll I'm evaluating Delphi XE6 on Windows 7 64bit, I wish to use FireDAC to connect to MySQL database. I have downloaded libmysql.dll and install the file in C:\Windows\SYSTEM32\ . After trying to set TFDConnection.Active to true during designed time, I got error dialog as displayed below. So I tried to use TFDPyhsMySQLDriverLink , I have set TFDPyhsMySQLLink.VendorLib to C:

Problem with TdxComponentPrinter (Delphi)

主宰稳场 提交于 2020-01-17 02:41:29
问题 TdxComponentPrinter is a componenet that allow me print a TPanel on a paper. But there is problem and when the panel contains TImage, the background of the image will be converted to black in the paper. Before print : After print (on the paper) : I have tried different ways to solve this problem. for example i used Repaint; method of TPanel,... but doesn't work and the background of image is still black. I don't know why!!! Help me please. 回答1: This is a png file, which might not be supported

Minimum requirements to deploy FireMonkey on Windows

时间秒杀一切 提交于 2020-01-16 19:41:10
问题 What are the minimum requirements for a Windows machine to run an application developed in FireMonkey? Can it run any machine that can run a VCL applications? Specifically can it run on XP? 回答1: From the documentation Windows Requirements The GPU must support Pixel Shader 2.0, part of DirectX 9.0, which first appeared from various vendors in these products: ATI (now AMD) Radeon 9500-X600 series, introduced in 2002. Intel GMA 900, introduced in 2004. NVIDIA GeForce FX (or GeForce 5) series,

FireDAC ResultConnectionDef and information about Server and Port

馋奶兔 提交于 2020-01-16 18:41:27
问题 DelphiXE 10.2.2 Was checking here old http://codeverge.com topic where back then was working, but now with ResultConnectionDef for getting information about established connection (Server and Port). ZeosLib (ZeosDBO) code: procedure TMainForm.UpdateCaption; begin Caption := Format('Truice %s - Connection: %s:%d / %s', [VERSION_EXE, MyTrinityConnection.HostName, MyTrinityConnection.Port, GetDBVersion]); Application.Title := Caption; end; With FireDac: uses FireDAC.Phys.MySQLDef, FireDAC.Stan

Help with Delphi 7, ADO, & MS Access SQL Statement

老子叫甜甜 提交于 2020-01-16 18:26:09
问题 I have three tables (in a MS Access Database 2000 file *.mdb) Knowledge id question answer Knowledge_Keywords id knowledgeid keywordsid Keywords id keyword Need to get all the keywords for a knowledge Select distinct keyword from keywords KW Join knowledge_keywords KKW on KKW.keywordid = KW.id Join Knowledge K on K.id = KKW.knowledgeid Where k.id = 10 of course 10 is a example, i actually use a parameter there Where k.id = :AKnowId'; and fill it in in code qry.Parameters.ParamByName('AKnowId'

Use Delphi serialization via JSON with C++

泪湿孤枕 提交于 2020-01-16 18:14:09
问题 Knowing that C++ does not have reflection I had a look at Delphi techniques and found an example using the REST.JSON library for serialization: Convert Object to JSON ... Now I would like to use a Delphi class, which can be serializied and deserialized with the provided methods, in my C++ code: TFoo = class(TObject) private public Fa: Integer; Fb: Double; end; In the C++ unit the class is serialized and deserialized like this: #include <REST.Json.hpp> #include "TestJson.hpp" //Contains TFoo

Reading the last line in a Tmemo in delphi

跟風遠走 提交于 2020-01-16 18:06:11
问题 After trying for a very long time .... decided to ask for help. I'm trying to read the last line sent to a Tmemo in Delphi. I'm sending lines of code one by one to a dev. board the dev. board needs different lines of code sent to it every time. My end goal is to read back the last line the dev. board sends back. E.G Set ATT = 7 --->> \sent to dev. board Dev. Board replies O.K <----- \ received from dev. board send next line of code. Or E.R.R send "set att = 7" command again. So far, I've got