delphi-2009

Requirements for JSON Parser

I'm thinking about implementing JSON parser for Delphi. What should a good JSON parser do? Any ideas for requirements? I believe it should at least output and process JSON... Looking at XML parsers, should it be more DOM or SAX-like? ...

How do I go about diagnosing memory corruption errors occurring in a COM-DLL after porting it from Delphi 2007 to Delphi 2009?

I have just ported several of our home-made Outlook COM-addins from Delphi 2007 to Delphi 2009 and am now experiencing some really weird errors (before you ask: none of which appear to have any obvious relationship to string-handling), for example modal dialogs that hang Outlook when one tries to invoke them a second time (the first time...

Why are my units "compiled with a different version" of my own files?

I'm building a program that uses plugins. Unfortunately, the plugin framework's dynamic linking forces the RTL and VCL out of my project EXE and into the BPL versions, and they don't have debug info enabled. So I built a testing framework that links to my plugins statically so I can actually see what I'm doing while tracing through the...

TClientDataset -- XML mapping.

I'm trying to save data in a TClientDataSet to an XML file, but it doesn't like some of my fields. The helpfile says to create a definition, in one of two ways: either with the xmlmapper.exe file in my \bin folder or with an IDOMDocument interface. Problem is, xmlmapper.exe isn't there, and IDOMDocument is one of those annoying structu...

Why LoadLibrary Fail only when EXE is launched from the IDE ?

Hi guys, On Delphi 2009, on a new VCL project: procedure TForm1.FormCreate(Sender: TObject); var Handle: THandle; begin Handle := loadlibrary('oci.dll'); if Handle <> 0 then begin try ShowMessage('Success'); finally FreeLibrary(Handle); end; end else ShowMess...

Delphi Printing Techniques

Where can I find a good resource for adding print capabilities to my program? I found this page: http://efg2.com/Lab/Library/Delphi/Printing/index.html but it hasn't been updated in 5 years, and I'd like to know if, with Delphi 2009, StretchDIBits is still preferred to StretchDrawMap, how to best support pagination, preview, etc. To da...

Delphi 2009 COM/ActiveX Type Library support stability

Referring to TLB and maintenance issues ... My question to people (often) using the new COM/ActiveX type library support in Delphi 2009: How stable is the implementation? Especially, I'm interested in: adding/deleting classes, changing GUIDs, renaming methods/properties, reordering methods/properties, huge type libraries (50+ classes),...

Delphi SMTP component that supports UTF-8 or Unicode

It appears the Indy 10 SMTP component shipped with Delphi 2009 do not properly support unicode in the subject and body. Does anyone know of a good alternative, or has anyone made the necessary changes to Indy10 to solve this issue? Update: Thanks for all the answers, I've done a bit of investigation, and thought I might be able to so...

Delphi 2009 RawByteString vagaries

Suppose that for some perverse reason you want to display the raw byte contents of a UTF8String. var utf8Str : UTF8String; begin utf8Str := '€ąćęłńóśźż'; end; (1) This doesn't do, it displays the readable form: memo1.Lines.Add( RawByteString( utf8Str )); // output: '€ąćęłńóśźż' (2) This, however, does "work" - note the conc...

Delphi 2009 classes / components to read/write file permissions

Does anyone have a set of classes / components that will work with Delphi 2009 (Unicode) to read and write NTFS file permissions? There was a thing called "NTSet" - but they stopped development at Delphi 2006 about 3 years ago :-( Any other takers?? Thanks! Marc ...

Howto cast pointer to generic parameter type?

Hello everybody, it's my first question here, glad to have found this site. My question deals with the new Generics feature in Delphi 2009. Basically I tried to write a generic wrapper class for an existing hash map implementation. The existing implementation stores (String, Pointer) pairs, so in the wrapper class I have to cast between...

Memory Leak in TDictionary - Problems with Workaround?

Hi everybody, I just considered using the new TDictionary type. But On QualityCentral I read about two memory leaks caused by TDictionary: http://qc.codegear.com/wc/qcmain.aspx?d=67355 I just implemented the proposed workaround, basically subclassing TDictionary, overriding the destructor and manually freing the two objects that cause...

Delphi 2009: Is it possibly dangerous to use TList<[any interface]> with default comparator?

Hello everyone, I am wondering if the usage of a generic TList<T> where T is any interface type (except IUnknown/IInterface) might be dangerous. I am heavily using interfaces and store them in lists. Some interfaces are my own, some are provided by some COM-interfaces, so COM is involved. I see a potential problem where checks for inst...

Displaying unicode text in Rave Reports on Delphi 2009

I am in the process of porting a Delphi 2006 app to Delphi 2009. Out of the box support for unicode has been easy - almost no work required. Most 3rd party controls already have Delphi 2009 updates available. Rave Reports (latest version 7.6.1, available here) has also been updated, but I cannot seem to get it to correctly display RTF t...

What is Codepage 0?

I'm using the Delphi function StringCodePage I call it on a string returned by a COM function (Acrobat Annotation getContents - see my other posts) and it returns 0. What is 0? Ansi? Thanks ...

Why is GenTLB renaming symbols (appending '_')

I am using GenTLB.exe to compile a ridl file to .tlb and _TLB.pas files. In the resulting _TLB.pas file, there are hints that it has renamed a number of symbols by appending an underscore to the end of the name. A sample of the hints is: // Errors: // Hint: Symbol 'Assign' renamed to 'Assign_' // Hint: Enum Member '_amStretch' of ...

Advice on moving to a multi tier Delphi architecture

We have a relatively large application that is strongly tied into Firebird (stored procedures, views etc). We are now getting a lot of requests to support additional databases and we would also like to move a lot of the functionality from the client to the server. Now seems like a good time to move to a 3(4) tier architecture. We have a...

Using Project Config with Delphi 2009 and Finalbuilder 6

Does anyone have any experience of using the project config option with the Delphi Compile Action in Finalbuilder 6. Currently the build server is set up to manually have all the correct search paths, Compiler options etc set directly on the compile action. This avoids changes to the config file breaking the build, and also search path...

Datasnap : Is there a way to detect connection loss globally ?

Hi everybody, I'm looking to detect local connection loss. Is there a mean to do that, as with the events on the Corelabs components ? Thanks EDIT: Sorry, i'm going to try to be more specific: I'm currently designing a protoype using datasnap 2009. So i've got a thin client, a stateless server app and a database server. What i would ...

Delphi MSBuild Build Configurations From Command Line

Delphi 2009 uses build configurations. When you create a new project you have two default build configurations "Debug" and "Release". Now I asked myself how to automate builds using MSBuild (which is supported by Delphi since version 2007). You can start the "msbuild" command in the "RAD Studio Command Prompt" in some Delphi project di...