-
December 23rd, 2006, 12:47 PM
#1
I can not call the forms declared in Form1.h
Hi friends, i'm a new programmer. During an application, i want to call a form by clicking somewhere. For example, when i click Help/About Menu, i want the About.h form to start.
To do this, i declare it like that;
#include "About.h"
.
.
.
private: About^ aboutBox;
.
.
.
.
.
aboutBox = gcnew About;
--------------------------------
But there are many errors when i debug,
such as;
error C3845: 'MyMessenger::Form1::aboutBox': only static data members can be initialized inside a ref class or value type
please help me about this problem. Do you suggest any other methods?
-
December 23rd, 2006, 05:57 PM
#2
Re: I can not call the forms declared in Form1.h
In the MSND library, i saw such an example to display user defined dialogs;
{
Form ^ f = gcnew Form();
f->ShowDialog();
}
And i changed this code to display my About.h form dialog such as;
{
Form ^ About = gcnew Form();
About->ShowDialog();
}
But, i still see the same empty dialog instead of my About.h form. So how can i display this dialog when i click About menu ?
-
December 23rd, 2006, 06:46 PM
#3
Re: I can not call the forms declared in Form1.h
That code isn't Visual C++. You may do better in an appropriate forum.
-
December 23rd, 2006, 07:19 PM
#4
Re: I can not call the forms declared in Form1.h
Originally Posted by GCDEF
That code isn't Visual C++. You may do better in an appropriate forum.
I found the codes in my second message from MSDN VC++ 2005 samples, and there may be some differences from 2003 version, so i don't think Microsoft is doing such a great mistake !!!
Last edited by Noreturn; December 23rd, 2006 at 07:22 PM.
-
December 23rd, 2006, 07:33 PM
#5
Re: I can not call the forms declared in Form1.h
Originally Posted by GCDEF
That code isn't Visual C++. You may do better in an appropriate forum.
Yes, it is - but it's managed C++, so it should be moved to the Managed C++ and C++/CLI forum.
@Noreturn: The code you posted is not enough to analyze your problem. Please post more complete code - and use code tags when doing so.
-
December 23rd, 2006, 07:43 PM
#6
Re: I can not call the forms declared in Form1.h
Originally Posted by gstercken
Yes, it is - but it's managed C++, so it should be moved to the Managed C++ and C++/CLI forum.
@Noreturn: The code you posted is not enough to analyze your problem. Please post more complete code - and use code tags when doing so.
Thanks for your suggestion...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|