1
votes

My system configurations are a follows Delphi2010 on windows 7 professional. I have a problem with some of .dfm files in the project. I got it as follows. First of all I needed to change some datatypes of TOraQuery component fields from TStringField to TWideStringField and I started it doing manually like opening .dfm change one by one (Find-Replace) everything was fine later on because our project is huge I decided to change everything at once so by using Notepad++ editor and by using option Find in Files and replace all I did replacement. So after this operation I started getting this error like 'TWideStringF class not found' when I wanted to open particular .dfm file. I cannot open this .dfm files even if I press ignore. PS: Even when I try to open files that has errors in Notepad++ editor to get the line TWideStringF I cannot find it. How to solve this problem ? Can anyone give me a clue ? thank you.

2
You probably need to rollback your source code to what it was before and try to do the find/replace again. Could it be that Notepad++ only replaced characters and did not append any new. TStringField has the same number of characters as TWideStringF. Coincidence?Mikael Eriksson
The problem is I do not have a backup files for the this part of project. And it must be TWideStringField not TWideStringF(this class doesn't exists and I know that), my question is how I can find TWideStringF line in .dfm file, because I opened .dfm file with editor and searched for TWideStringF occurrence but I could not find.Shahriar
You have done an incorrect replace -- that's not the way to do it... -- at any rate, try reverting to a previous version and why not leave it as TStringField anyways?user497849
@Shahriar You don't have backup? You aren't using revision control? You have serious problems which will not subside until you correct this. All software development needs revision control.David Heffernan
+1 for the revision controll.... But maybe you do have some that you don't know about. Delphi keeps history in the IDE. Maybe you can delete your .pas and .dfm (make a backup first!) and swap in another one, created with the same names, from a different directory. Now see if the Delphi history lets you revert back to a prior, non-broken one. Just an idea.Chris Thornton

2 Answers

0
votes

Try finding the "TWideStringF" in ALL your source code first to know where the problem is comming, after that, well, all dependes on what you find!

0
votes

The Delphi IDE need to be able to find the classes specified in the DFM. It creates instance of these on the design surface for you to interact with.

Editing a DFM by hand is a common practice. I do it often, as sometimes it is faster than any other method. However, it comes with a problem if the class or property can not be found it can cause the DFM not to load. So extra care must be taken to insure that manual edits done correctly.

In this case you can restore the file, and redo the search and replace, or to look at the instances where it's broken and fix them all by hand.

Search for: TWideStringF I suspect you will find that is missing the remaining ield required. Note: Searching in IDE will not work as it won't search DFM files.