I am trying to do the following in Delphi 2010:
TDataConverter = class abstract
public
function Convert<T>(const AData: T): string; virtual; abstract;
end;
However, I keep getting the following compiler error:
E2533 Virtual, dynamic and message methods cannot have type parameters
I don't quite understand the reason why I can't d...
I am storing a list of numbers (as Double) in a text file, then reading them out again.
When I read them out of the text file however, the numbers are placed into the text box as 1.59993499 for example, instead of 1.6.
AssignFile(Pipe, 'EconomicData.data');
Reset(Pipe);
For i := 1 to 15
Do ReadLn(Pipe, SavedValue[i]);
Close...
Hi,
Does anybody know the trick, how to free control inside its event handler ? According delphi help it is not possible...
I want to free dynamicaly created TEdit, when Self.Text=''.
TAmountEdit = class (TEdit)
.
.
public
procedure KeyUp(var Key: Word; Shift :TShiftState);
end;
procedure TAmountEdit.KeyUp(var Key: Word; Shift :TSh...
i am looking an funtion to reverse any string (YYYYMDD,YY/MM/DD,YYMMDD,...) created by the function FormatDateTime to datetime.
example
i have a string-date in format YYYYMMDDcreated by FormatDateTime
mydatestr:=FormatDateTime('YYYYMMDD',Mydate);
now how i can convert mydatestr to DateTime again?
UPDATE
these functions
function...
i am looking the fastest way to insert many records at once (+1000) to an table using ADO.
option 1)
using insert commands and parameters
ADODataSet1.CommandText:='INSERT INTO .....';
ADODataSet1.Parameters.CreateParameter('myparam',ftString,pdInput,12,'');
ADODataSet1.Open;
option 2)
using TAdoTable
AdoTable1.Insert;
AdoTabl...
I know about $(Delphi) and $EDNAME but after much seaching I cant find a list of these and any others for use in libary path names etc.
Can anyone oblige please?
...
I have a DBGrid above a group box with some buttons and edit fields and another group box below that again with some buttons. I cannot fins a setting for the align and/or anchors for the DBGrid and the group boxes so they fill the form without overlapping or leaving blank bits of form.
I am using Delphi 5 on XP Pro with all updates ins...
Hi,
Has anyone ported "Snoop Component Suite version 3.0" by http://www.netlab.co.kr
To Delphi 2010 ?
Its a great WinPCap library. Just doesn't work on Delphi 2010 (unicode)
Thanks
...
Having a popup menu attached to several components on a form (buttons, but also things like TCharts), I would like to know which component was right clicked to start the popup menu in the first place.
The Sender parameter of the click method just points to the TMenuItem, its parent to the popup menu (or the parenting menu item).
How do...
Hi.
We have some Delphi code that uses the BDE to Access SQL Server 2008 through the SQL Server Native Client ODBC driver (2005 version). Our issue is that we're experiencing some deadlock issues in a loop doing inserts to multiple tables.
The whole loop is done within a [TDatabase].StartTransaction. Looking at the SQL Server Profil...
This is really a follow on question to a previous one, where I need to register applications, TLBs and OCXs per user, rather than into HKLM. I have written the following code - based on answers here and elsewhere, BUT the TLB is not registered - no error is thrown, just nothing happens (this code snippet comes from the Embarcadero websit...
I want to pass constant references to functions in delphi, so I am sure that the referenced object won't change and to save time and memory. So I want to declare a function like
function foo(var const Value : Bar) : Boolean;
however this is not allowed. I thought constant values would be automatically sent as references. However I fou...
Hey,
I need to be able to convert from a Delphi Real48 to C# double.
I've got the bytes I need to convert but am looking for an elegant solution. to the problem.
Anybody out there had to do this before?
I'm needing to do the conversion in C#
Thanks in advance
...
I'm developing an windows app on Delphi 2007 and I'm using "Ttaskdialog" component in it. Using windows XP it runs normally, but in Windows 7 I'm getting the following message:
TtaskDialog requires themes to be enabled
Any clues how to fix it?
...
Below just a simple race between 2 button in 2 threads,
and this will freeze other components on the form.
procedure moveButton1();
var
I: Integer;
begin
for I := 0 to 6000 do
Form1.Button1.Left := Form1.Button1.Left - 1;
Form1.Caption := 'Button1 won!';
EndThread(0);
end;
procedure moveButton2();
var
I: Integer;
begin
...
Hi,
I am new to Writing Windows Service apps and having problems.
Written in Delphi, I have written a normal windows application to check and debug the major parts of the code and now have to convert it to an NT Service.
My code has to launch a windows application which I do using the following code.
function Run_Program : boolean;
...
Is Delphi have any ability to write script of IDE actions? I would like On open delphi project execute script opening some unit. How I can do this.
...
I am writing a toolbar-style control and use the ThemeServices unit to paint the background required by the toolbar. Like so:
ThemeServices.DrawElement(Canvas.Handle,
ThemeServices.GetElementDetails(trRebarRoot), ARect);
I then drop child controls onto the toolbar and voila - instant toolbar. Except that every now and again I notic...
i have two projects in a project group:
ProjectA
ProjectB
Whenever i open the ProjectGroup.bpg in Delphi, it always starts with the 2nd project as the active one:
ProjectA
ProjectB
And every time i have to flip it to the the "real" project:
ProjectA
ProjectB
How can i make ProjectA the default project that opens with the proj...
Basically I don't know from where to start, I need to add a line script for my application that is not so complicated, just to execute pre-defined commands, for instance:
command> New Invoice --> create new invoice
command> customer profile --> open customer form where cust id = CustID
command> run End-Of-Day - run the end of day p...