I created a project with a single form in C++ Builder and added some source/header files. Everything resided in the same directory and worked fine. When I renamed and moved the form (.dfm file) and the matching source code (.cpp and .h) to a different directory, I was no longer able view the form in design mode.
The form is still there, the project compiles fine and the final executable works as expected too. I am stuck.
Never used Borland C++ myself, but it probably just doesn't know the file is there. If you have something like a project view, import your renamed version into that.
It's been a while since I last used Delphi (the only Borland product I ever touched in my life), but I believe dfm files are not the actual form files, they are just textual representations of them.
That's what I mean. That's not the actual form file. That's just a human readible version that exists for... I don't know, I guess the GUI uses it for something. But it's not what the form is actually stored as.
That confused me back then too, but I did read that in the delphi manual.
The IDE uses that code to generate the form. In fact, if you modify this code...say change the client width and height, then these changes are reflected on the actual form. I know because I just did it.
The original TFormMain.cpp had a line: #pragma resource "*.dfm"
I changed it to: #pragma resource "TFormMain.dfm"
Then I changed it back to: #pragma resource "*.dfm"
Now, the form does not appear instantly when I open the project, but only when I do the following:
1. Press Ctrl+F12
2. Select TFormMain (or the name you've given your form) from the list
3. Press F12 for the form to appear
I don't know exactly what happened but it works. Anyone know better, please lets us know.