Click to See Complete Forum and Search --> : Need Serious Help! New to visual C++


rocky_upadhaya
January 13th, 2010, 04:54 AM
Hello! As a student of Computer Science, I am not new to C++ and I also have done fair bit of programming in csharp and Visual Basic. But at this time I am finding it really hard working on windows form application in visual c++. I am currently using Microsoft Visual Studios 2008. I am really ashamed not to able to show even a form if I click on Botton present in Form1. I tried to work my way up by looking at the sample application but I was buzzed. So please Help me to make a simple program. I have posted below a sample project please evaluate it........I want to show up second Form If I click on the button.

GCDEF
January 13th, 2010, 07:14 AM
I don't have anything on my PC that will open .rar files but the fact that you're mentioning forms suggest you're probably in the wrong forum. If you're using .net, you need to go to the managed C++ forum.

marsh
January 13th, 2010, 11:25 AM
I opened your project and was hailed with some errors. The first problem is that you are including Form1, you changed the name of that form though.

In stack.cpp Change

#include "Form1.h"

to

#include "Home.h"


That will at least start showing you the errors. As for your problem of showing the form i have no idea how. Sorry.

Arjay
January 13th, 2010, 04:23 PM
This is managed C++. If you want to write a C++ app with MFC, you've created the wrong project type.

rocky_upadhaya
January 14th, 2010, 06:34 AM
Thanks For the suggestion. I will again start the exact thread in managed C++ forum....

rocky_upadhaya
January 14th, 2010, 06:40 AM
Hello! As a student of Computer Engineering, I am not new to C++ and I also have done fair bit of programming in csharp and Visual Basic. But at this time I am finding it really hard working on windows form application in visual c++. I am currently using Microsoft Visual Studios 2008. I am really ashamed not to able to show even a form if I click on Botton present in Form1. I tried to work my way up by looking at the sample application but I was buzzed. So please Help me to make a simple program. I have posted below a sample project please evaluate it........I want to show up second Form If I click on the button.

ovidiucucu
January 14th, 2010, 07:47 AM
[ Merged threads ]

memeloo
January 16th, 2010, 07:04 AM
rename your Home form to Form1 first or rename all other currances of Form1 to Home (it's not c# and it won't be renamed automaitcally)
add #include "PostFix.h" in Form1.h
add using namespace Stack; below the last #include (because it's a different namespace form Stack1)
add ^ before frmNewItem because it's a reference type replace new PostFix(); with gcnew PostFix(); because it's a managed code


a fixed version of your project attached

rocky_upadhaya
January 16th, 2010, 09:47 AM
please say what changes i required to make it run?? I'm all confused....is working on visual C++ is far harder than C# or java? I know Intermidiate level of understanding of syntax of C++ but only on console level...:(

memeloo
January 16th, 2010, 10:30 AM
please say what changes i required to make it run?? I'm all confused
you're kidding me, right? have overlooked my last post where I attached the fixed version? there is a list of changes I made or you'll have to make yourself.

rocky_upadhaya
January 16th, 2010, 10:36 AM
Yeah! I got your fixed version and thanks for the Help....I was just asking what changes did you make to make the previous version work?? please dont get angry...this complex statements of visual c++ is foolin me too....cheers...

memeloo
January 16th, 2010, 10:51 AM
ok, so here's the list one more time:

---
files should have the same name as the class inside. so, you should either rename your Home.h file to Form1.h (because the class is called Form1 or rename all other ocurrances of Form1 to Home (it's not c# and it won't be renamed automaitcally if you change the filename)

---
add #include "PostFix.h" in Form1.h so that the Form1 class is aware of the existence of the PostFix class. (if you need some class that is defined in a different file you always have to include the header file (acually not always but for now it's ok))

---
add using namespace Stack; below the last #include in the Form1.h file (this is like c#, I think you already know that ;]

---
add ^ before frmNewItem because it's a reference type

---
replace new PostFix(); with gcnew PostFix(); because it's a managed code (new is for unmanaged, native classes)

these are all changes I made. hope this helps.

rocky_upadhaya
January 16th, 2010, 11:00 AM
thanks again dude! I am now slowly getting flow of visual c++