Link to home
Start Free TrialLog in
Avatar of MAVERICK
MAVERICKFlag for United States of America

asked on

(Visual C++ 6.0) Errors opening new form

I have a test program using a main "dialog form" and a second sub-form, accessbile via a button "OnSubForm"

I'm getting these errors on successive lines during compile.
error C2143: syntax error : missing ';' before '^'
error C2227: left of '->ShowDialog' must point to class/struct/union

#include "stdafx.h"
#include "AppParent.h"
#include "AppParentDlg.h"
#include "CustomUI.h"
void CBEParentDlg::OnSubform()
{
      // TODO: Add your control notification handler code here

      CCustomUI^ cf = gcnew CCustomUI();
      cf->ShowDialog();
}
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

VC 6 doesn't support .NET code
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Appears to be a .net application. You can download Visual C++.net 2008 to test it.
Visual c++.net 2008 Express Edition (free):
http://www.microsoft.com/express/vc/
Avatar of MAVERICK

ASKER

Hi

I normally program in C# these days, but for this project I intend to use VC++ 6.0, as related programs are compiled in 6.0 not .NET

Will test Andy's solution tonight.

Thanks




Hi Andy,

Yeap, your right.

For completeness - here is the working code.

void CBEParentDlg::OnSubform()
{
      // TODO: Add your control notification handler code here

            CCustomUI* cf = new CCustomUI();
            cf->Create(IDD_CUSTOMUI_DIALOG);
            cf->ShowWindow(SW_SHOW);
}

Thanks
@ MAVERICK
You are expected to close questions yourself (successfully answered that is) by accepting a comment by one (or more if more than one made relevant contributions) expert as the answer.
If you do not then another expert has to take time to read the question and comments and make a recommendation.
Sorry I forgot to close the question before.