open new Form in project

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2008
Posts: 173
Reputation: Lukezzz is an unknown quantity at this point 
Solved Threads: 1
Lukezzz Lukezzz is offline Offline
Junior Poster

open new Form in project

 
0
  #1
Dec 17th, 2008
I have a project that consist of 2 Forms. I am trying to open Form2 with this code but when I compile the project I have this compile error and wonder what this meens and why it doesn´t work.

cannot convert from 'System::Windows::Forms::Form ^' to 'Form1::Form2 ^

1> No user-defined-conversion operator available, or
1> Cast from base to derived requires safe_cast or static_cast


  1. #include "Form2.h"
  2.  
  3.  
  4. Form2^ newform2 = gcnew Form;
  5. newform2->ShowDialog();
Last edited by Lukezzz; Dec 17th, 2008 at 6:30 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 122
Reputation: Liszt is an unknown quantity at this point 
Solved Threads: 6
Liszt Liszt is offline Offline
Junior Poster

Re: open new Form in project

 
0
  #2
Dec 17th, 2008
Try this:

#include "Form2.h"


Form2^ newform2 = gcnew Form2;
newform2->ShowDialog();
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 173
Reputation: Lukezzz is an unknown quantity at this point 
Solved Threads: 1
Lukezzz Lukezzz is offline Offline
Junior Poster

Re: open new Form in project

 
0
  #3
Dec 17th, 2008
Yes ofcourse, that was the problem. Thank you... !
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 983 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC