Solved

(Visual C++ 6.0) Errors opening new form

Posted on 2008-10-04
8
515 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
only14 challenge 19 89
isEverywhere  challenge 19 91
twoTwo  challenge 35 119
ClickOnce Install - Shortcut Question 3 111
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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…

751 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