Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 533
  • Last Modified:

(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();
}
0
MAVERICK
Asked:
MAVERICK
  • 3
  • 3
  • 2
1 Solution
 
AndyAinscowCommented:
VC 6 doesn't support .NET code
0
 
AndyAinscowCommented:
I suspect you want something like the following
CCustomUI* cf = new CCustomUI();
cf->Create(PUT YOUR PARAMETERS HERE);
cf->ShowWindow(SW_SHOW);

OR

CCustomUI cf;
cf.DoModal();
0
 
Jaime OlivaresSoftware ArchitectCommented:
Appears to be a .net application. You can download Visual C++.net 2008 to test it.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Jaime OlivaresSoftware ArchitectCommented:
Visual c++.net 2008 Express Edition (free):
http://www.microsoft.com/express/vc/
0
 
MAVERICKAuthor Commented:
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




0
 
MAVERICKAuthor Commented:
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
0
 
AndyAinscowCommented:
@ 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.
0
 
MAVERICKAuthor Commented:
Sorry I forgot to close the question before.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now