Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

(Visual C++ 6.0) Errors opening new form

Posted on 2008-10-04
8
Medium Priority
?
531 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 45

Expert Comment

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

Accepted Solution

by:
AndyAinscow earned 1000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 45

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…

972 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