delphi

How can I create a IDataObject instance with Delphi?

This C++ code shows how OLE can be used to simulate a file drag and drop to simulate a 'Send to...' operation. This will open the standard mail client with the selected file(s) as an attachment, a very interesting alternative to the mailto: protocol handler. Which is the best (short and safe) way to create the neccessary instance of ID...

Return value of function might be undefined

Ok, I have the following function: function TfPackagedItemEdit.GetRTFDescription: TStringList; begin Result.Text := richDescription.Lines.Text; //stringlist end; The compiler generates the following warning about this line: [DCC Warning] W1035 Return value of function 'GetRTFDescription' might be undefined Any ideas on how I can c...

How to force Delphi compiler to display all hints and warnings

Is there a way to force the Delphi compiler to display all hints and warnings all the time? Here is the behavior that I am currently seeing in Delphi 6: Check out fresh copy of my application from source control Open project in Delphi and Compile All hints and warnings for the project are displayed Make a change in one unit Compile On...

Why does Delphi (dcc32.exe) have an option to set a "Namespace search path"?

The compiler (dcc32.exe) in Delphi 2007 and 2009 has an option -NS<namespaces> = Namespace search path Is this releated to the compiler options 'Default namespace' and 'Namespace prefixes' in the project options dialog? Search 'path' sounds like a folder (directory) name, so I am not sure what this option is good for. ...

Delphi ActiveX in IE - Showmodal is not very modal

Hi, I have an active form written in delphi, hosted in IE. When I popup a Tform with showmodal i can still interact with the activex form behind it. I am pretty sure my app never used to do this. I have noted mixed results when playing with popupmode pmAuto and pmNone, but not the answer I am looking for. Please help! ...

Has anyone written a Session Monitor for Intraweb?

I am thinking of writing a session monitor (or manager) for my Intraweb application that would list the current active sessions and allow the user to terminate any of those sessions. Does anyone has source code for this already? I saw that ArcanaTech.com had a product called Intraweb Server Manager at one time that looks like it did ex...

Setting Label and StaticText Color property problem - Delphi 2009

When I set the Label's color e.g. on value clRed, the red on it only blink for a while. The color property still has clRed value, but in fact it has default clBtnFace color. Screenshot discribes the problem better. ...

Changing pictures by clicking on the TImage component - Delphi

I want to change picture loaded into Image1 - from one called 1active.png to second called 1inactive.png and vice versa by clicking on the Image1 component. Is there any way to do it? ...

Copy const array to dynamic array in Delphi

I have a fixed constant array constAry1: array [1..10] of byte = (1,2,3,4,5,6,7,8,9,10); and a dynamic array dynAry1: array of byte; What is the easiest way to copy the values from constAry1 to dynAry1? Does it change if you have a const array of arrays (multidimensional)? constArys: array [1..10] of array [1..10] of byte = . ....

Delphi & shared datasources

In my app I have different forms that use the same datasource (so the queries are the same too), defined in a common datamodule. Question is, is there a way to know how many times did I open a specific query? By being able to do this, I could avoid close that query without closing it "every where else". Edit: It's important to mention t...

How do I display XML using an XSLT document, in a Delphi app?

I've been given a sample XML file (ultimately my client will receive several of these each day), and an XSLT file which will apparently transform the XML into something with a meaningful layout, suitable for displaying in a browser or printing. I'd like to put something into an existing legacy Delphi app, such that the user can pick one...

Delphi application and (Zimbra) CalDAV protocol

I have an old (nineties) Delphi 2 Tier application that now needs to talk to a calendaring system. The users are going to take information from the Delphi application and create appointments. These appointments will need to be sent to a multi calendaring Zimbra server. They will be creating appointments in calendars belonging to other me...

Call to TMouse.GetCursorPos sometimes fails with "A call to an OS function failed"

On occasion my application gets the error below. Normally this happens when the user steps away from their desk leaving my program open. When they come back this error has appeared. TMouse.GetCursorPostion does not do anything except make the Windows API call to GetCursorPosition. Then it checks the return value and calls GetLastEr...

How to unload a file from cache?

Hi. Anybody knows how to unload a file from cache? I write a file to disk, then I want to read it back. However, Windows is giving me the file from cache. begin ... {-- Write file --} AssignFile(F, FileName); Rewrite(F, 1); BlockWrite(F, Buf[0], Chunk); CloseFile(F); { FLUSH } some code... then..... {-- Read file -...

Generic Linked List for Delphi 2009

I was looking in Generics.Collections and noticed there was no linked list. Sure they are simple to make, but I thought it was odd there was not one (or I just missed it). Are linked lists just outdated when compared to new modern data structures, or is there a need for a general generic linked list? Does anyone know of one? ...

Max length for a dynamic array in Delphi?

I was curious how long a dynamic array could be so I tried SetLength(dynArray, High(Int64)); That has a value of 9,223,372,036,854,775,807 and I figure that would be the largest number of indexes I could reference anyway. It gave me a: ERangeError with message 'Range check error'. So I tried: SetLength(dynArray, MaxInt); and...

Add values to web.config in webservice

I Need add custom values to AppSettings in a webservice i have this code, but nothing happens. procedure TWebService1.AddStrConn(KeyConn, ValueConn: String); var config : System.Configuration.Configuration; begin config:=ConfigurationManager.OpenExeConfiguration(System.Reflection.Assembly.GetExecutingAssembly().Location); config.AppS...

[Delphi 2009] Debugger displays useless info on user breaks

Hi all, It's a silly point, but I haven't been able to find the answer by myself : In delphi 2009, when I hit the "pause" button ("Suspend program execution") while debugging, the IDE pops the CPU window, and shows me the execution point and stack of the thread which actually stopped the execution, instead of the main thread - which is...

How to recognize the Registered classes in a Delphi Package

Hi all, I am going through most of my applications and porting them to D2009 and I have one application that makes use of dynamic packages. For the life of me I cannot get my host application to recognize classes registered in a package. I traced through and the initialization section in the package being loaded was called and RegisterC...

Delphi: No VarIsBoolean( )-function?

In variants.pas, there is several VarIsXXX( )-functions for type-checking a variant. There is no VarIsBoolean( ), though. What's your preferred way of checking if a variant is of type boolean? ...