Zjarek
Junior Poster in Training
79 posts since Oct 2009
Reputation Points: 20
Solved Threads: 18
managed c++ does not use new -- it uses gcnew. And you have to make W2 a pointer. The braces are unnecessary.
Window2^ W2;
W2 = gcnew Window2;
W2->Show;
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
I'm sorry, I didn't know about it and I think it's weird. Why microsoft would want to change syntax so much?
Zjarek
Junior Poster in Training
79 posts since Oct 2009
Reputation Points: 20
Solved Threads: 18
The third line should be W2->Show(); -- needs the parentheses.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
What are the errors? Copy and paste them instead of paraphrasing, please. Also, how is Window2 defined?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
You did not make the changes I suggested. You forgot to add the ^ in the declaration of W2. Window2^ W2; Just like c++ and C W2 has to be a pointer. Pointers in CLI are designated with ^ instead of *.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Amazing. You failed to provide both pieces of information I requested.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>>PS: I'm an ameture programmer. I'm not in college. I'm a high school seinor. I was just asking for help, not for you guys to do it for me.
If you want to learn to program then you have to learn to read, comprehend, and follow instructions. Both Narue and I have offered to help you but you have so far failed to provide the information we need to do so.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Did you add #include "Window2.h" at the top of that file? I just compiled the code you posted and did not get any erors or warnings, and it ran just as I expected it to run.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
I put it at the top of the *.h file
#pragma once
#include "Window2.h"
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343