34
голосов
5ответов
7212 просмотров

Are there any advantages in using const parameters with an ordinal type?

I know marking string parameters as const can make a huge performance difference, but what about ordinal types? Do I gain anything by making them const? I've always used const parameters when handling strings, but never for Integer, Pointer, class instances, etc. When using const I often have ...

1
голосов
2ответов
1926 просмотров

Button component affecting the parent Panel in Delphi

I'm writing a program consisting of dynamically created panels that each have a few components in, including a delete and add panel buttons. Each panel displays 20 pixels times the panel number below each other, OnClick for add must add another panel to the end of the set and OnClick for delete m...

21
голосов
4ответов
25254 просмотров

Iterate through items in an enumeration in Delphi

I want to iterate through the items in an enumeration. I'd like to be able to say something like this: type TWeekdays = (wdMonday, wdTuesday, wdWednesday, wdThursday, wdFriday); ... elementCount := GetElementCount(TypeInfo(TWeekDays)); for i := 0 to elementCount - 1 do begin ShowMessage(G...

1
голосов
3ответов
951 просмотров

Is there some way to load the TSQLConnection params from an ini file in design time?

I have a SQLConnection which is shared between projects, in runtine it reads the configuration from an ini file, is there some way to load this same configuration in design time?

3
голосов
1ответов
1744 просмотров

Where can I find a good Delphi or Object Pascal implementation for a circular buffer

My main purpose is to have a generic data buffer that I can use for transfers. I'm thinking of something along the lines of what XCopy did. Is there something already made out there or a good example one can follow?

10
голосов
3ответов
4625 просмотров

Class Helper for generic class?

I'm using Delphi 2009. Is it possible to write a class helper for a generic class, i.e. for TQueue . The obvious TQueueHelper <T> = class helper of TQueue <T> ... end; does not work, nor does TQueueHelper = class helper of TQueue ... end;

3
голосов
4ответов
1230 просмотров

Shuffle Text File Delphi Source or anything else

I have a stringlist with 10,000 entries. I have a shuffle routine, but accessing any of the items is taking a lot of time. Going through all 10k items takes a huge amount of time. I want to save it do disk and then do a shuffle on the file using another method. Any suggestions?

0
голосов
1ответов
1441 просмотров

How to use AccessibleObjectFromWindow WinAPI function in Delphi?

http://msdn.microsoft.com/en-us/library/dd317976(VS.85).aspx STDAPI AccessibleObjectFromEvent( __in HWND hwnd, __in DWORD dwObjectID, __in DWORD dwChildID, __out IAccessible **ppacc, __out VARIANT *pvarChild ); What is IAccessible** equivalent in Delphi (2009)?

0
голосов
1ответов
1202 просмотров

ApdComport reporting ECommNotOpen when calling ProcessCommunications

I have a fairly complex application in Delphi 2006 that communicates through an ApdComport using a separate form in another thread. The communication used to fail quite a lot and I found a couple of calls to Application.Processmessages in the loops and reconstructed it using the ApdComport.Proces...

0
голосов
10ответов
2116 просмотров

How to explicitly pass a program flow into the finally block in C#?

In Delphi I could do something like this: try if not DoSomething then Exit; if not DoSomething2 then Exit; if not DoSomething3 then Exit; finally DoSomethingElse; end; In other means if method DoSomething results false then the program flow is transffered to the finally bl...

16
голосов
6ответов
7728 просмотров

Delphi Conversion Unicode Issues

We have large commercial app that we want to convert from Delphi 6 to 2010. Approx 10 3rd party component sets, all with source code... I have heard warnings about Unicode with 2010 - Does anyone have experience and or suggestions?

4
голосов
2ответов
1020 просмотров

Rules to Develop a Delphi Windows 7 App

Where can I find the best set of rules to follow for developing a Delphi application for Windows 7?

1
голосов
2ответов
1815 просмотров

Delphi 7 Personal, MySQL using libmysql.dll + UTF8

I'm using Delphi 7 Personal. To access MySQL database I'm using libmysql.dll + very simple wrapper, which is good enough for me. Except one thing ... it doesn't seem to handle Utf8... is that possible somehow to pass Utf8 strings from libmysql to Delphi? Please keep in mind I'm not using commerci...

6
голосов
3ответов
11043 просмотров

Convert UTC string to TDatetime in Delphi

var tm : string; dt : tdatetime; tm := '2009-08-21T09:11:21Z'; dt := ? I know I can parse it manually but I wonder if there is any built-in function or Win32 API function to do this ?

4
голосов
4ответов
2695 просмотров

How to return an instance from a DLL?

I am programming a DLL. I have to return an instance of TBitmap to the host application. The DLL has another UNIT, wich is a Form, that it has a TImageList for storing images. I wrote a function that I want to return an Image from the TImageList (from the DLL to the host application. How can I do...

1
голосов
3ответов
661 просмотров

Any way to "force" a program with a hung OCX to close?

My Delphi 7 program uses an OCX to control some hardware. I don't have any sample code so I am working through loading/using/unloading the control correctly. Unfortunately, if I use the hardware and load the OCX, the main process will not completely quit when the application closes. If I use th...

1
голосов
2ответов
3218 просмотров

How do I stream ReportBuilder Reports as PDFs on Intraweb using ExtraDevices?

We use Intraweb for our Web Applications and also have been using ReportBuilder for reporting for our internal windows applications. We also have ExtraDevices which we've used to allow us to save our ReportBuilder reports as Excel files. Now, I am want to produce a report on our web applicati...

8
голосов
3ответов
7313 просмотров

Is FindFirst supposed to return found files in Alphabetical order?

I had tought that FindFirst found files in alphabetical order but recently i am finding that while this is true for the most part a few files are not in alphabetical order. if FindFirst( AProgramPath, faAnyFile, ASearchRec ) = 0 then repeat AFilename := ASearchRec.name; until FindNext( ASearch...

4
голосов
6ответов
1722 просмотров

How do I make my Delphi 5 app display password "blobs"?

Pretty simple one, but I can't find the answer. I'm building an app in Delphi 5 Enterprise, and want my app to use the new bold black dot in a password field instead of an asterisk. How can I do this?

0
голосов
1ответов
1439 просмотров

BDS2006 and Zeos installation

I recently installed Zeos 6.6 stable on BDS2006 for both the Delphi and C++ personalities. In order to do so, and since Zeos is written in Delphi, I checked the "Generate all C++ Builder files" when building the packages. The problem I found was that, somehow, not all necessary .DCUs were gen...

3
голосов
1ответов
2796 просмотров

Can't see WSDL on Delphi CGI with IIS7

I created a very simple Delphi 2010 CGI web service and am able to get the exact same problem on Delphi 2007. My invokable interface looks like this: ISimpleTest = interface(IInvokable) ['{4E318A9A-D361-4A18-A963-EE6D7F70E9C5}'] function SayHello(const S: string; N: Integer): string; stdcall;...

6
голосов
4ответов
3247 просмотров

Passing Static arrays as parameters for Dynamic arrays in Delphi

I have this array: const / var _Data : array [0..4] of array [0..3] of Double = ((0,0,0,0), (0,0,1,1), (1,0,1,0), (1,1,0,0), (1,1,1,1)); I wanna pass it as param value for this procedure: procedure NN.NetTraining(Data: TDoubleMatrix); Where: TDoubleArray = ...

11
голосов
2ответов
13845 просмотров

How do I recognize command-line parameters in my Delphi program?

I plan to run specific application commands every X days using Task Scheduler. Do I have to write support for command-line parameters first, so Scheduler can execute it? If so, does anyone know any good command-parameter components?

4
голосов
2ответов
6786 просмотров

How to draw on the entire area of a resized TImage in Delphi?

I've narrowed a problem I have drawing on TImage.Canvas in Delphi 2009 down to the following reproducible case: Given: a form, a TImage, TLabel and TButton on it. The TImage is anchored to all four edges so that resizing the form will resize the TImage. What I want to be able to do is draw on th...

0
голосов
1ответов
951 просмотров

How can i CloseComm, OpenComm, WriteComm and ReadComm with the windows unit?

I have an old comm unit that uses WinTypes,WinProcs. As i understand these were merged too the Windows unit. Are there similar functions in the Windows unit?

2
голосов
1ответов
623 просмотров

Files needed to deploy delphi 2010 dbxpress application

I'm having trouble deploying my delphi application. It uses dbxpress to access mysql 5.1 database. When i run the application from another computer, an error occurs. I've already included the midaslib.dll in my application and copied the dbxmys.dll and libmysql.dll in the same folder as my applic...

0
голосов
2ответов
1013 просмотров

run a ruby script from delphi via shellexecute

I've written a little ruby script that lets me send emails by calling it along with some command line parameters. At the command line, this works: ruby.exe mail_it.rb fromaddr="[email protected]" tolist="[email protected]" But try as I may, I can't get it to work in Delphi 2007 for Win32....

1
голосов
2ответов
3412 просмотров

Getting windows ‘ShFileOperation’ API to recursively delete files in Delphi

I am using the following code to delete a large number of files function FastDelete(const fromDir: string): Boolean; var fos: TSHFileOpStruct; begin ZeroMemory(@fos, SizeOf(fos)); with fos do begin wFunc := FO_DELETE; fFlags := FOF_FILESONLY or FOF_NOCONFIRMATION o...

0
голосов
1ответов
1514 просмотров

Delphi: TTcpServer, connection reset when reading

I'm trying to implement a Fitnesse Slim server for delphi, but have some problems with the communication. Fitnesse will start my process, and give me a portnumber as a commandline argument. Then I'm supposed to create a socket at the given portnumber, and Fitnesse will connect to that port. I...

1
голосов
4ответов
3982 просмотров

Display progress from time consuming process

Sorry for my bad English... Using Delphi 7 I want to create a dialog window to show that something is happening in my application when i have to run slow processes. My idea was to do something that i can use like: with TMyDialog.Create do begin //call the time consuming method here Free; end...