Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have programmatic success in instantiating a user class/form that inherits another user class that in turn is derived from System::Windows::Forms::Form. But, the WinForm designer fails to load/display this form, and complains:

The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: CWizardPage1 --- The base class 'ATPGUI.CWizardPage' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.

But, if I replace this line:

ref class CWizardExample : public ATPGUI::CWizardFormBase


with this:

public ref class CWizardExample : public System::Windows::Forms::Form


the WinForm designer can load/display the form. But, I will not have access to WinForm-based control/properties defined in CWizardFormBase. I do have access to those defined in CWizardExample.

The CWizardExample class begins as follows:

public ref class CWizardFormBase : public System::Windows::Forms::Form


All sources reside in the same MVS 2008 WinForm application project.

Thanks in advance!
Posted

1 solution

I have never tried this for a simple reason: when I started developping GUIs in C++/CLI, it was so painful and frustrasting compared to C# that I quickly decided to stop.

I know my answer will not help you much but for me C++/CLI should be used only to mix native and managed code, write wrappers, and so on. And it shouldn't be used for designing a full application with WinForms for example.

My advice is:
- use C# for your GUI
- use C++/CLI for your wrappers and mixed code
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 15-Mar-11 21:48pm    
The rare case of the post of _very_ unrelated to the Question, still offering a valuable and practical general advice. My 5, sure.

I would add and advice to minimize the visual part of development, or limit it to the visual targets, such as layout.

Visual timer and even visual event handler are just stupid things designed to please lamers. They are highly ineffective. The form inheritance, too: at the level of code much more supportable and very easy with introduction of partial classes.

--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900