MAVERICK
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();
}
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();
}
VC 6 doesn't support .NET code
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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/
http://www.microsoft.com/express/vc/
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
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
ASKER
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_DI ALOG);
cf->ShowWindow(SW_SHOW);
}
Thanks
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_DI
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.
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.
ASKER
Sorry I forgot to close the question before.