Solved

(Visual C++ 6.0) Errors opening new form

Posted on 2008-10-04
8
511 Views
Last Modified: 2013-12-03
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
Comment
Question by:MAVERICK
  • 3
  • 3
  • 2
8 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22639990
VC 6 doesn't support .NET code
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 250 total points
ID: 22639992
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
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 22640392
Appears to be a .net application. You can download Visual C++.net 2008 to test it.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 22640395
Visual c++.net 2008 Express Edition (free):
http://www.microsoft.com/express/vc/
0
 
LVL 1

Author Comment

by:MAVERICK
ID: 22641679
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
 
LVL 1

Author Comment

by:MAVERICK
ID: 22643403
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
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22666991
@ 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
 
LVL 1

Author Closing Comment

by:MAVERICK
ID: 31502998
Sorry I forgot to close the question before.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
java ^ examples 8 69
abstract class with all non abstract mentods 6 80
Excel file not created as expected 7 79
Infrastructure development vs software development 3 61
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question