.netuser-interfacerefactoringvisual-c++-2005

divide large VC++ .NET GUI header file


I've inherited a GUI in the format of a 10,000 line Visual C++ .NET Form1.h file and 3 megabyte Form1.resx. The previous author essentially put down lots of buttons to mock up the interface, implemented a few things, and then ran out of steam. My task is to finish it. The management does not want to lose their "investment" on it, and I'd rather keep whatever is done as well.

Is there anything I can do to divide this monster into smaller files, and perhaps even organize it somewhat? Right now, it's large enough that editing tasks are slow. It can only get slower. The existing functionality is implemented directly in the Form1.h file, so preferably I'd rather keep the actions/events attached to the UI elements.

I just figured out how to create a new managed resource file and copy-paste UI elements, but that doesn't include certain properties such as names, or events.


Solution

  • The management does not want to lose their "investment" on it

    This is a flawed position. Whether it's the right move to throw something out and start over depends on how much work there is left to complete it, not on how much work has already been done. At this point, they're just throwing good money after bad.

    Treat the existing application as a prototype design and implement it properly from the ground up, because that will probably be faster than trying to fix up this monstrosity.