CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13
  1. #1
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    Smile Need Serious Help! New to visual C++

    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.
    Last edited by rocky_upadhaya; January 16th, 2010 at 10:48 AM.

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Need Serious Help! New to visual C++

    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.

  3. #3
    Join Date
    Sep 2008
    Posts
    70

    Re: Need Serious Help! New to visual C++

    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

    Code:
    #include "Form1.h"
    to

    Code:
    #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.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Need Serious Help! New to visual C++

    This is managed C++. If you want to write a C++ app with MFC, you've created the wrong project type.

  5. #5
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    Re: Need Serious Help! New to visual C++

    Thanks For the suggestion. I will again start the exact thread in managed C++ forum....

  6. #6
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    New To the Visual C++

    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.
    Last edited by rocky_upadhaya; February 11th, 2010 at 06:29 AM.

  7. #7
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Need Serious Help! New to visual C++

    [ Merged threads ]
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  8. #8
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: Need Serious Help! New to visual C++

    1. 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)
    2. add #include "PostFix.h" in Form1.h
    3. add using namespace Stack; below the last #include (because it's a different namespace form Stack1)
    4. add ^ before frmNewItem because it's a reference type
    5. replace new PostFix(); with gcnew PostFix(); because it's a managed code

    a fixed version of your project attached
    Attached Files Attached Files
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  9. #9
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    Re: Need Serious Help! New to visual C++

    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...

  10. #10
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: Need Serious Help! New to visual C++

    Quote Originally Posted by rocky_upadhaya View Post
    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.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  11. #11
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    Re: Need Serious Help! New to visual C++

    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...
    Last edited by rocky_upadhaya; January 16th, 2010 at 11:42 AM.

  12. #12
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: Need Serious Help! New to visual C++

    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.
    Last edited by memeloo; January 16th, 2010 at 11:54 AM.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  13. #13
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    Re: Need Serious Help! New to visual C++

    thanks again dude! I am now slowly getting flow of visual c++

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured