Dear All,

I am trying to understand how to create SDI based on ViewForm class that has a different dialog in the mainframe according to the type of user that has logged.

I have been playing our this afternoon and noticed that when you click on the ".rc" file in the resource folder you can create add a new dialog. Then I went to the view class and adding to his enum the token identifying the dialog ID.

(Something like "enum{IDD = IDD_DIALOGTEST_FORM, IDD1 = IDD_FORMVIEW1, IDD1 = IDD_FORMVIEW2}")


After this I have modified the constructor method of the myview class changing the paramenter that gives to the CFormView upper class.

(Something like "CDialogTestView::CDialogTestView()::CFormView(IDD1){}")

The goal I wanted to achieve was to change the token basing on the login and for this I tried to call the super constructor from the constructor method body:

(Something like "CDialogTestView::CDialogTestView(){
if(login==1){
CFormView(IDD1);}
else{CFormView(IDD);}
}")



Unfortunately it gives me the following error at compile time:
error C2512: 'CFormView' : no appropriate default constructor available

I was wondering if anyone know already a better way of doing this and if MICROSOFT has already implemented a class or method to do so.

Thanks for ur attention and Best Regards!

PS: If interested please find the source file and the project for VS 2008 at
http://www.2shared.com/file/12618099...ialogTest.html

Size approx 6.6 MB