delphi

Trapping Exception using TSQLQuery & params

I am getting a "SQL Server Error: arithmetic exception, numeric overflow, or string truncation" error here is the code below AQuery:= TSQLQuery.Create(nil); with AQuery do begin SQLConnection:- AConnection; SQL.Text:= 'Insert into.....'; ParamByName('...').asString:= 'PCT'; . . . try ExecSQL; finally AQuery.Free; end; end;...

Delphi 2010: New RTTI, setting propertyvalue to arbitary value

TRTTIProperty.SetValue( ) takes an TValue instance, but if the provided TValue instance is based on a different type then the property, things blow up. E.g. TMyObject = class published property StringValue: string read FStringValue write FStringValue; end; procedure SetProperty(obj: TMyObject); var context: TRTTIContext; rtti: T...

How to wash/validate a string to assign it to a componentname ?

I have a submenu that list departments. Behind this each department have an action who's name is assigned 'actPlan' + department.name. Now I realize this was a bad idea because the name can contain any strange character in the world but the action.name cannot contain international characters. Obviously Delphi IDE itself call some method...

Can Delphi 5 generate a .PDB file that VS can use?

We've got this large application written in Delphi 5, and development is ongoing to this day. There is research going on into migrating to newer versions, but so far there is no success, as some 3rd party components have not been updated in ages and do not work on later versions. In the meantime however people need to continue work on i...

Is FindFirst,FindNext & FindClose Thread safe in delphi

Is FindFirst,FindNext & FindClose Thread safe in delphi ? If not what should be used in there place ? ...

How do I force the linker to include a function I need during debugging?

I often make small methods to assist debugging, which aren't used in the actual program. Typically most of my classes has an AsString-method which I add to the watches. I know Delphi 2010 has visualizers, but I'm still on 2007. Consider this example: program Project1; {$APPTYPE CONSOLE} uses SysUtils; type TMyClass = class F ...

Problems opening Access Database from Delphi 7

I am developing Delphi 7 application, which is operating with Access Database (MDB format). It works fine on my PC, and some other PCs as well. But on some machines application gives error when trying to access database sometimes, saying something like "Unkown database format (mdb)". Additionally I noticed one thing: When you open that d...

Creating digital persona fingerprint template from serialized data

This is a very specific question which will probably earn me the tumbleweed badge, but please answer if you can I've imported DigitalPersona sdk dll's as type libraries into Delphi and am trying to verify fingerprints which I've stored as serialized data in a database, it's working very awesomely. Enrollment seems to work fine, but I c...

unicode & special characters in delphi 2009

our delphi win32 app uses special characters like micro and copyright. we mostly use the arial. before delphi 2009, we had to provide a way to prevent the micro character from displaying since for some (many/most?) parts of the world, it was not displayed correctly. we'd replace micro with u, copyright with (C)... now that we're in d...

array component with string keys

About two years ago I have found a component that can be used to create array with string keys on delphi... anyone know a component like this?? ...

need to add a progress bar for when a (blocking) DLL call is busy

my delphi 2009 app uses a DLL that performs some activities that may take several seconds. i'd like to show a progress bar. unfortunately the DLL call is a blocking call & has no callback function. a way i've been considering is to add a TTimer to my app. when the timer event fires, i look at the time and use that to calculate the...

Why was TDataSource created originally?

What was (or would be) the reasoning behind creating TDataSource as an intermediary between data bound components and the actual underlying TDataSets, rather than having the components just connect directly to the TDataSets themselves? This may seem like kind of a stupid question, but I am working on a broad set of "data viewer" compon...

How to add to a generic TList<Value, TDictionary> in Delphi

I'm trying to use a generic dictionary of objects where they key is a string, and the value is a TDictionary. Is this possible? I don't see why not, but I don't know what the syntax would be to add to the dictionary. I've tried a few things but can't quite get it right. Perhaps TPair has to be used somehow. This code demonstrates ...

Book recommendation for moving from Delphi 6 to Delphi 2010

Hi, I am a long time Delphi 6 developer. Looking for a book on Delphi 2010. Not only on the new features available in Delphi 2010, but more importantly, guideline on how different it is to develop applications in Delphi 2010, the architecture, standard and convention, etc. Thanks a lot. ...

VCLSkin, TDBGrid column header skinning?

Hi, Having tried VCLSkin from http://link-rank.com, i came to an issue where column header skin didn't work on TStringGrid descendants including TDBGrid. I want it to display header similar like TListView colum header in report mode. Anyone has code to solve this problem? PS: already looked http://andy.jgknet.de/blog/?page%5Fid=206, ...

Generating a new Random GUID in the Delphi IDE

How I can generate a random new GUID inside of the Dephi IDE? I am using Delphi 2007. ...

How to create a case in-sensitive TEqualityComparer for TDictionary?

Hi, I have a case using TDictionary: var D: TDictionary<string, integer>; begin D := TDictionary<string, integer>.Create(TCustomEqualityComparer.Create()); try D.Add('One', 1); D.Add('Two', 2); D.Add('Three', 3); showmessage(inttostr(D.Items['One'])); showmessage(inttostr(D.Items['TWO'])); finally D.Free;...

TAPI, lineInitialize and lineInitializeEx

I try to use TAPI in my Delphi project. When I use lineInitializeEx instead of lineInitialize I get an error msg like "Exception Processing Message c0000139 Parameters 168fc8 162820 75b4bf7c 75b4bf7c" The code with lineInitializeEx is : var initPrm: TLineInitializeExParams; begin FillChar(initPrm, SizeOf(initPrm), 0); in...

Delphi - preview a Rave report on the form

How can I preview a rave report on a Delphi form? I have a page control with 2 pages: on the first one the user enter some data (name, address...) and I want on the second page to preview the report generated with the data from the first page. ...

Is there a way to override previous registred actions with a shortcut ?

I have a unit with a lot of actions, some actions have shortcuts and some have even the same shortcut. This is because they belong to different modules in applications and they are not in context at the same time. Now I have a global nonmodal dialog (called objectinspector) that can be started anytime anywhere. It have some actions wit...