Mega Code Archive

 
Categories / Delphi / Ide Indy
 

Some issues with Delphi 2005 and their solutions

Title: Some issues with Delphi 2005 - and their solutions Question: While Delphi 2005 is definitely better than Delphi 8, there are still some bugs/issues that may be fixed in a Service Pack some time, meanwhile here are a few issues and some things that have changed, but appear as issues at first glance Some of the issues have to do with the fact that in .NET you may share your assemblies with other .NET languages, which may be case sensitive or have some reserved words Answer: 1)When you right click on a web form and select "Set as Start Page", it may not work correctly, to ensure that certain page is the default page for a web site, change that directly from IIS Right click in your web site, properties, Documents, add the name of your default page there 2)CS1031: Type expected If you create a web application and you name your web form default.aspx and run it, you will get an error: CS1031: Type expected seems like the "default" word conflicts with something else in .NET, specifically with C#, perhaps because default is a reserved word in C# (for the switch statement) solution, name your web form something else 3)Unsupported language feature: destructor if you declare a class like: TMyClass = class destructor destroy; end; you get the error [Error] default.pas(XXX): E1025 Unsupported language feature: 'destructor' you would think, what???!?!? On this one I'm guessing because TMyClass is implicitly class(TObject) the error comes from there, but in that case (like in previous versions of Delphi) the error should've been "Method Destroy hides virtual method of base type TObject" or something similar, this again has to do with how things work in .NET, but I think the only problem here is the error description If you add override, it fixes the problem TMyClass = class destructor destroy; override; end; now for the constructor TMyClass = class constructor Create; virtual; destructor Destroy; override; end; in the implementation of the code constructor TMyClass.Create; begin end; you can't leave the implementation empty, at least the inherited constructor must be called, if you leave it empty, you'll get the error [Error] default.pas(XX): E2304 'Self' is uninitialized. An inherited constructor must be called so it needs to be written like this constructor TMyClass.Create; begin inherited end; and so you are forced to use the contructor on the antecesor class (and it is important to be aware of this) 4)Uninstalling Delphi 8 may mess up your Delphi 2005 installation if you had both Delphi 8 and Delphi 2005, and uninstalled Delphi 8 you may encounter some errors when starting Delphi 2005 and/or when working with it some of the errors are - class not registered - some registry key is not found etc... to fix it, simply go to: Control Panel, Add Remove Programs Select Borland Delphi 2005 click on "Change", it should bring up the installation dialog, which then will let you Repair your installation (will create the necessary Registry Entries and register the required DLLs) Note: if you try to start the Delphi installation without doing these steps you may get an error saying the installation cannot continue because Delphi 2005 is already installed There are a few other issues, I'll keep updating the article frequently as I find more issues and their solutions if you have seen any other issues and you know the solutions, please post a comment so we all can benefit keep checking here for more articles about delphi.NET best regards if you made it this far, here's something that may interest you I have GMail accounts to give out to whoever emails me at ebersys[RemoveThis] at gmail . com EberSys