delphi-6

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...

Delphi 6 IDE and apps working on windows 7 64 bit?

I have a commercial app that is developed with Delphi 6. Ive been developing under windows xp 32 bit, but am about to get a new development machine with Windows 7 64 bit. Will Delphi 6 install and work in the new environment ? The developed app also uses the BDE, on vista I couldnt get it to work at all, which meant my customers had t...

Unsafe cast in delphi sometimes gives a nil only on certain machines?

We have some code something like this (Delphi 6 RTL Update Pack 3): objChild1 := TChild1.create(); ... (Some Code) objProcessor.function1(objChild1); Tchild1 is inherited from TGrandPa through 2 + hierarchy levels. function1 is defined like this where objChildData is a private variable of TProcessor class and is of type TChild1 : TP...

How to debug a Custom Property Editor in Delphi 6 (Pro)?

How can I set breakpoints and trace through a Custom Property Editor I wrote for one of my VCL derived components (Component Palette member)? The problem of course is that I want to debug code that is running in a compiled BPL while the IDE is active and is not running an active application. Setting breakpoints in the BPL source file d...

Delphi 6 storeproc on windows 7

I work with Delphi 6 and SQL Server 2008. With Windows Vista everything runs ok. But since i change my OS to Windows 7 all my projects started to show a message when i'm trying to compile them that says "Stored procedure (SPname). Doesn't found or doesn't exist in the server. I look my server and it has the Sp with the correct name. i u...

Delphi 6 - Bugs disappear when I compile multiple times.

My Delphi installation has been going downhill for the past few months. It seems though that every so often when I build a release it has strange errors in it which are resolved if I build, then compile, then build, compile, etc. I've talked to another developer who thinks that this is a compiler error. This sort of degrading perfor...

Delphi - How to prevent Forms/MsgBoxes to move under prior form?

Hi! Many times we experienced after Windows 98 era that some dialogs are lost their Z-Order, and moved back to prior form. For example: Dialog1.ShowModal; Dialog1.OnClickButton() : ShowMessage('anything'); When MessageBox appears, sometimes not got focus, it is moved under Dialog1. The users confused on it, because they are say: ap...

Delphi - Is there any equivalent to C# lock?

I'm writing a multi-threaded application in Delphi and need to use something to protect shared resources. In C# I'd use the "lock" keyword: private someMethod() { lock(mySharedObj) { //...do something with mySharedObj } } In Delphi I couldn't find anything similar, I found just TThread.Synchronize(someMethod) method, ...

What's the difference between public and published class members in Delphi?

Please could someone explain me what's the difference between public and published class members in Delphi? I tried to look at Delphi help and I understand that these members have the same visibility, but I don't understand very well how they differ and when should I use published members instead of public ones. Thanks a lot. ...

Reading a unicode string from SQL Server with Delphi 6

Hello, I need to read a nvarchar(max) field from a SQL Server 2008 database using Delphi 6 and ADO. I can handle the unicode text just fine but it seems the ADO component is "preconverting" the string to code page before I even get to have a look at it. I've tried accessing the field as a TBlobField but it gives me the converted ve...

"form already exists" after form is closed and another instance opened. Delphi

I keep running into this strange problem. It almost seems to be random but I run my application and open a form, do some work with it and close it. The next time I go to open another isntance of that form I get an error message about the form already existing. This is very odd and I haven't been able to constantly reproduce the error....

Code Syntax Highlighting in Delphi 6 (to highlight syntax and ifdef blocks)

Delphi 6 is pretty old, I know. Unfortunately there are reasons why I can't upgrade which I don't want to get into here. My problem is that it's hard to read code. I have the Castalia plugin which helps a bit (parenthesis matching, shows blocks of if, else, end) but it doesn't highlight the syntax like other IDEs do (variables, cons...

Delphi - What happens with un-freed (but terminated) thread when application exits?

Hello, I have multithreaded application and I've got a little problem when application ends: I can correctly terminate the thread by calling TThread.Terminate method in Form1.OnDestroy event handler, but the termination does take some time and so I can't free the memory (by TThread.Free method). Unfortunately for some other reason I mus...

Checking if memory is allocated before calling FreeMem (Delphi 32)

I have been running into errors where objects are somehow freed but we end up calling FreeMem on them. Of course this causes an error since the memory has already been freed and throws an error. I know that a try-catch block would probably fix it but that's a lot of try-catch blocks. With the regular object.free the way to avoid this ...

What is the difference between compiling and building in Delphi?

With Delphi-6 there are two options: Build and Compile. I know when I run a program it compiles only the files which have changed and uses the DCUs for those which haven't. When I click build apparently it rebuilds the DCUs. What I have been wondering is, when I make a program for release (changing build settings, conditional variable...

Delphi TChart using AddNullXY and trend function

I have TeeChart version 7.07. I have a chart with a FastLineSeries with 400 datapoints (x is date and y is used%). the first 200 are valid dates with actual measured % values. the next 200 are valid dates in the future with 0 as the YValue that were added using AddNullXY (date,0,datelabel). I also have a FastLineSeries as a trend funct...

Delphi - equivalent to C# DateTime.IsDaylightSavingTime() method needed

Hello, I need somehow to determine whether some TDateTime value is within the Daylight Saving Time range for my timezone or not (in C# the same thing does the DateTime.IsDaylightSavingTime() method). I know in Delphi there's no similar function, because Delphi TDateTime contains no information about timezone, but I suppose there's some ...

Free memory and nil in Delphi using a single function.

I have a lot of memory allocations and the same number of FreeMem calls. What I didn't have though is a check before calling freemem to see if the pointer was nil, and a line after freeing to set the pointer to nil. I tried to create a function to do this procedure FreeMemAndNil(p: Pointer; size: Integer = -1); begin if p <> nil t...

Insert an image on each row in an Excel Sheet with Delphi

My Delphi 6 program need to place an image on each row of my of Excel Sheet. I could insert a picture to a fixed position with something I read from another post. procedure insertImages(ActiveSheet: OleVariant; ImageFilePath: String; ImageHeight, PictureTop, PictureLeft: Integer); var Picture: OleVariant; begin try Picture ...

Delphi - Cross-thread event handling

I have a small client-server application, where server sends some messages to the client using named pipes. The client has two threads - main GUI thread and one "receiving thread", that keeps receiving the messages sent by server via the named pipe. Now whenever some message is received, I'd like to fire a custom event - however, that ev...