delphi

Use a Datamodule in a Service Application

I wrote my Win32 App to test and debug. I've created a datamodule with all functionality needed to run the TCP sockets and IBDatabase components. After successfully testing the Datamodule in the Win32 application environment I am trying to hook the Datamodule into a Service Application template that I created, I can get nowhere in getti...

How to prevent inputting Russian characters in Word with a Word addin?

Hi, Sorry for this vaguely described problem, but please look at the problem from the Win32 API's perspective. I'm writing a Word addin using Addin Express with Delphi, and I use some other 3rd party VCL's also, including virtual stringtree, TNT controls, etc. Now I cannot input Russian characters in Word anymore, but I can input Engli...

Delphi 7: how to execute shell command and check the result?

I'm using Delphi 7 and can't predict the target version of Windows. I need to create a database (probably MySql, but might be something else) and define some table structures. I do not need to populate any data. Unfortunately, all of the ADO components seem to expect that a database already exists and they will then allow you to manipul...

Live Template for Delphi that generate a Property with getter / setter and create the private field?

Searching here and on the internet have not let me to a example of a Live Template for Delphi that generate a Property with getter / setter and also generate the private field and execute the complication. (SHIFT + CTRL + C) Is this possible? ...

Tool that shows unit dependencies for Delphi 2010 or Delphi 7 program

We're trying to untangle a hairball of 100's of units, removing some. It would be helpful if there was tool that would show us what units were explicitly using unit X. Penganza doesn't seem to have a report that does that. (Although it has lots of other useful reports.) Can anyone suggest a tool or strategy for doing this, other than ...

Streaming multiple TObjects to a TMemoryStream

I need to store multiple objects (most of them are TObject/non persistent) to a TMemoryStream, save the stream to disk and load it back. The objects need to be streamed one after each other. Some kind of universal container. At the moment I put all properties/fields/variables of an object into a record and save the record to stream. But...

Looking for a communication framework for delphi

I am looking for a communication framework for delphi, we know there are so many communication frameworks for other languages , wcf, ecf and so forth, but i have nerver found the one for delphi till now , anybody who knows about it can give me an ider? There are some requirements i need ,as follows: Building an application(server or ...

Delphi/Pascal training in high school/college/university

Are Delphi/Pascal being taught in any high schools/colleges/universities, particularly in Canada and the US? I was surprised how many schools in the UK are teaching Delphi. Their largest exam board is even dropping PHP/C#/C in 2011 and encouraging Delphi. I also remember that CodeGear was going to provide development tool licenses to ...

Why can't I start the Windows Update control panel with WinExec?

In Executing Control Panel Items, MSDN says this: Windows Vista Canonical Names In Windows Vista and later, the preferred method of launching a Control Panel item from a command line is to use the Control Panel item's canonical name. According to the Microsoft website this should work: The following example shows how an ap...

Image as a background of a form in Delphi

I'm using Delphi 2006. I have a few PNG images with transparencies and I have to create a GUI using them (top bar, left panel...). The images have different aligns properties. One of the images is the background of the form. The problem here is that I can't align it as alClient because it only occupies the rectangular zone that the other...

How to determine if a file has finished transferring to be able to copy.

What is the best method to make sure that a file that is transferred via ftp has finished before another process attempts to move/copy that file? ...

IdHttp Post Method Delphi 2010

Like others before me, I'm having troubles using the IdHttp(Indy 10.5.5) component in Delphi 2010. The code works fine in Delphi 7: var XMLString : AnsiString; lService : AnsiString; ResponseStream: TMemoryStream; InputStringList : TStringList; begin ResponseStream := TMemoryStream.Create; InputStringList := TStringList.Create; ...

Fun with casting and inheritance

NOTE: This question is written in a C# like pseudo code, but I am really going to ask which languages have a solution. Please don't get hung up on syntax. Say I have two classes: class AngleLabel: CustomLabel { public bool Bold; // Just upping the visibility to public // code to allow the label to be on an angle } clas...

Passing an Object as an Interface

This should be a simple answer, i believe its going to be a no, but taken from a larger project, i have an interface and the procedure iMyUnknown= interface(IInterface) ['..GUID..'] end; procedure WorkObject(iObj :iMyUnknown); i know this works var MyUnknown : iMyUnknown; begin if supports(obj, iMyUnknown, MyUnknown) then Work...

Delphi : Handling the fact that Strings are not Objects

I am trying to write a function that takes any TList and returns a String representation of all the elements of the TList. I tried a function like so function ListToString(list:TList<TObject>):String; This works fine, except you can't pass a TList<String> to it. E2010 Incompatible types: 'TList<System.TObject>' and 'TList<System.str...

ODBC: when is the best time to create my database?

I have a windows program which generates PGP forms which will be filled in later. Those PHP forms will populate a database. It looks very much like MySql, but I can't be certain, so let's call it ODBC. And, yes, it does have to be a windows program. There will also be PHP forms which query the database - examine which tables and field...

How to load Firebird 2.1.X fbclient.dll on Windows XP wihout installing Microsoft C++ 2005 Redistributable (vcredist_x86.exe)?

Using fbclient.dll in Firebird 2.1.X in fresh install Windows XP that never install with Microsoft C++ 2005 Redistrubable will cause problem. I wish to deploy my application that contain fbclient.dll and all related Microsoft C++ 2005 redistributable libraries without installing the redistributable libraries. Can I do that? I am runni...

Reading data from a COM port

I want to get input from a barcode-scanner, which is connected to a CHD cash register, which is connected to a Windows XP PC trough a COM port. I want to read the data from the scanner and the cash register, and send the data to a program, which has a table with items in a shop. And provide a function which removes items, too. Where sho...

How to retrieve the file previews used by windows explorer in Windows vista and seven?

I am developing a Delphi documents management application, so somehow I am giving the user some functionality similar to windows explorer. I would like to know if there is a way to get the preview used by windows explorer. For example windows explorer creates a small thumbnail for a pdf document for example, and displays it when the use...

EUpdateError exception not recognized when raised in TDatasetProvider.OnUpdateError. Why?

When I re-throw a EUpdateError exception in the TDatasetProvider.OnUpdateError event, it is not recognized as EUpdateError exception in the catch block. It's only recognized as base Excption. try ... //calls the TDatasetPorvider.OnUpdateError event. myClientDataSet.ApplyUpdates(0); ... except on ex: EUpdateError do begin //...