In Delphi 2010,
if Field.OldValue <> Field.Value then
...
raises the Exception:
raised exception class
EVariantTypeCastError with message
'Could not convert variant of type
(Array Byte) into type (Integer)'.
How can I know if a TBlobField value has changed?
...
After creating a new form, I usually perform this ritual:
Change the name into something meaningful;
Type a Caption;
Change the position property (DefaultPosOnly is hardly ever what users expect);
Set ShowHint to true;
Set DoubleBuffered to true;
I've been wondering for a while why the default value is 'False'. To me it just looks ...
I am trying to get the window handles to a Delphi application from an external application. I can see that there are a few windows created (TApplication, TFrmMain and a few others), and I know that TApplication is the "controller", but never visible. However, can I read what the value for the real window is? I know that it is TFrmMain (f...
Is there any way with the current delphi to implement.
a) String (as a class) with operator overloads (ie. +, =)
b) Class Helper's so one could add custom string methods
I gather the string is a native type so class helpers will not work without
setting up a class etc.
...
I'm looking to create a singleton in Delphi. I've done this before using older versions of Delphi, and ended up using global variables (in the implementation section) and using initialization and finalization to take care of the instance. Also there was no way of preventing the user from creating an instance as you couldn't hide the stan...
I use Indy for TCP communication (D2009, Indy 10).
After evaluating a client request, I want to send the answer to the client. I therefore store the TIdContext, like this (pseudocode)
procedure ConnectionManager.OnIncomingRequest (Context : TIdContext);
begin
Task := TTask.Create;
Task.Context := Context;
ThreadPool.AddTask (Task...
Well this kind of n00b question but I still can't figure it out. I have unit main with procedure Discard() in it. Now I have another unit engine and I want to run from it procedure Discard() of unit main. I have main in uses section of engine.pas. I tried to call procedure with main.Discard() but no good. What am I doing wrong?
...
Hi,
I have a multi-window application. My main form is a child of the desktop. My application can create other forms that also become children of the desktop. However, I have a special case where my main form needs to create a form that will always stay on top of it.
I had this working to an extent....however, if I then create other wi...
I used Delphi 2006 data binding wizard to create a interface for an XML configuration file. Later on I realized that some repeated parts of the XML can be separated from the main file and referenced where needed. The resulting XML looks something like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module [
<!ENTITY Schema65 SYST...
I am learning assembler quite a while and I am trying to rewrite some simple procedures \ functions to it to see performance benefits (if any). My main development tool is Delphi 2007 and first examples will be in that language but they can be easily translated to other languages as well.
The problem states as:
We have given an unsigne...
This is a part of a program that analyzes the odds of poker, specifically Texas Hold'em. I have a program I'm happy with, but it needs some small optimizations to be perfect.
I use this type (among others, of course):
type
T7Cards = array[0..6] of integer;
There are two things about this array that may be important when decidin...
A component I am working on uses a TCollection to hold links to other components. When the items are edited in the designer their labels look something like this:
0 - TComponentLink
1 - TComponentLink
2 - TComponentLink
3 - TComponentLink
How do I add meaningful labels (the name of the linked component perhaps)? e.g.
0 - UserList
1 -...
The TScrollBox control looks like it's supposed to basically be a TPanel with scroll bars attached along the bottom and the right edge. I tried placing one on a form, but no matter what I do, I can't make the scroll bars actually appear, either at design-time or at runtime. Does anyone know how to make them show up?
...
From within a finally block, is it possible to tell an exception has been raised?
...
I can easly add a MRF list to A TRibbon recent items list but how do you add
the same list to a ribbon item set as a dropdownbutton? The dropdown
item is ActionBars[2].Items[1].
var
ARecentFilesList: TStringList;
ACI: TActionClientItem;
if FileExists( ARecentFilesFilename ) then
begin
ARecentFilesList.LoadFromFile( ARecentFilesFile...
In my multithread application
I use TThread.suspend and TThread.resume
Since moving my application to Delphi 2010 I get the following warring message
[DCC Warning] xxx.pas(277): W1000 Symbol ‘Resume’ is deprecated
If Resume is deprecated what should be used in place?
EDIT 1:
I use the Resume command to start the thread - as it i...
I have tried lots of methods associated with RibbonApplicationMenuBar to prevent a user from selecting the RibbonApplicationMenuBar with a mouse until the projects settings are loaded from an inifile and a splashform closes. But nothing seems to work to make the RibbonApplicationMenuBar InActive until told otherwise.
The help file show...
i want to halt my application when my bitmap is completely saved?
...
PLDelphi is a Perl project hosted on CPAN. I am currently working on a Delphi application and I am investigating the possibility of adding Perl scripting support and read about PLDelphi.
Ideally, I'd like my application to not require Perl to be installed. PLDelphi claims to support this:
To use PLDelphi from your Delphi
applicati...
When trying to run Delphi 7, I get this frightening message:
Borland license information was found, but it is not valid for Delphi. You cannot run Delphi without this information. Click the exit button to exit Delphi.
Delphi was running fine this morning, then choked when I tried to load the project on which I'm currently working. I rei...