CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15
  1. #1
    Join Date
    Jul 2010
    Posts
    5

    MFC Class Wizard Problem

    Hello,
    I am new to VC++ and started the book 'Learn VC++ in 21 days'. I have built a VC+++ controls Dialogue box containing buttons, combo box, edit box etc. Now, I wanted to attach variables to the controls. But, when I open the MFC Class WIzard and the Member variables tab in it, I dont find any ID's(to which these variables have to be attached) in the Controls ID space. i dont know what the problem is and i can progress further only if i can find a solution to it!

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

    Re: MFC Class Wizard Problem

    What version of Visual C++ are you using?

  3. #3
    Join Date
    Jul 2010
    Posts
    5

    Re: MFC Class Wizard Problem

    Visual C++ 6.0

  4. #4
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: MFC Class Wizard Problem

    try to create the project fresh once again and see, if it works fine....

  5. #5
    Join Date
    Oct 2009
    Posts
    577

    Re: MFC Class Wizard Problem

    If using VC7 to VC10 (VS2003 to VS2010) you right-click on the control and choose 'Add Variable'. The ID of the control you clicked on is already filled into the form to specify a new member variable.

    In VC6 you also would do it from resource editor. If I remember rightly just double-click on the control and you get a tabbed dialog where you could add member variable or event handler.

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: MFC Class Wizard Problem

    Quote Originally Posted by Manchiraju View Post
    ... when I open the MFC Class WIzard and the Member variables tab in it, I dont find any ID's(to which these variables have to be attached) in the Controls ID space. i dont know what the problem is and i can progress further only if i can find a solution to it!
    What IDs for what control are missing? Note that there won't be IDC_STATIC in the list, nor any radio button ID if radio button doesn't have "Group" checkbox to be checked.
    Victor Nijegorodov

  7. #7
    Join Date
    Jul 2010
    Posts
    8

    Re: MFC Class Wizard Problem

    I think maybe you need check if you choose the right class name you want.

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

    Re: MFC Class Wizard Problem

    Is there any possibility that you could get a newer version of VC?

    It makes it difficult to answer questions for folks that are running one of the 5 newer versions made available since VC6 was released in 1998.

  9. #9
    Join Date
    Jul 2010
    Posts
    5

    Re: MFC Class Wizard Problem

    @Arijay..Hi
    At work I have been allotted a computer which has VC++6. I have no other option but to work in that! But in my laptop I have got VC++2005 express edition installed. So, is VC++2005 much better than Vc++6?? and is it ok if I stick to VC++2005 or shift to the newer versions??

  10. #10
    Join Date
    Oct 2009
    Posts
    577

    Smile Re: MFC Class Wizard Problem

    Quote Originally Posted by Manchiraju View Post
    @Arijay..Hi
    At work I have been allotted a computer which has VC++6. I have no other option but to work in that! But in my laptop I have got VC++2005 express edition installed. So, is VC++2005 much better than Vc++6?? and is it ok if I stick to VC++2005 or shift to the newer versions??
    A switch from VC6 to VS2005 (VC8) is an important decision and would generate some major portation efforts depending on the amount of code to port.

    Problems with the class wizard alone surely won't justify such a decision.

    In VC6 you can let the class wizard regenerate the class informations. For that you close the Visual Studio and move the <your_project>.clw file to some backup folder. After that reopen your project with Visual Studio and invoke class wizard by CTRL+W. It will ask you to create a new clw file and let you choose the source files for that. After that your class where you had problems with should be "repaired" if that was the issue.

    Regards, Alex

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

    Re: MFC Class Wizard Problem

    Quote Originally Posted by Manchiraju View Post
    @Arijay..Hi
    At work I have been allotted a computer which has VC++6. I have no other option but to work in that! But in my laptop I have got VC++2005 express edition installed. So, is VC++2005 much better than Vc++6?? and is it ok if I stick to VC++2005 or shift to the newer versions??
    If you have a choice, use a newer version, but keep in mind the express versions of VC do not have MFC support. You'll need to get a professional version of VC2005, 2008, or 2010 in order to get MFC support. If you are a student and are trying to learn C++ and MFC then be aware that student discounts are available for the professional versions.

    For your issue in VC6, you can try to close your project, delete the .clw and .ncb files and reopen the project.

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

    Re: MFC Class Wizard Problem

    Quote Originally Posted by itsmeandnobodyelse View Post
    A switch from VC6 to VS2005 (VC8) is an important decision and would generate some major portation efforts depending on the amount of code to port.

    Problems with the class wizard alone surely won't justify such a decision.
    Yeah, the longer a development team waits to upgrade their environment, the more difficult the upgrade usually becomes.

    Part of the issue is that the compiler becomes more C++ compliant (and stricker) with each new version. So not only do you have to deal with the usual project file differences which the project upgrade wizard does a pretty good job of, but there are code changes where code written in VC6 simply will not compile in a later version (because the VC6 code wasn't compliant to begin with).

    As a business, it scares me to have to depend on a particular version of a tool, so to me it makes good business sense to stay current or reasonably current. About the only reasons I can think of for an organization to continue to use a 12 year old environment is that they are dependent on 3rd party dlls that aren't available in a newer compiler version, or they are targetting very old OS's.

    Of course, that's a business decision and it's up to each business to decide. However, for learning, there is little reason to ever start learning on a 12 year old compiler.

  13. #13
    Join Date
    Jul 2010
    Posts
    5

    Re: MFC Class Wizard Problem

    Thanks Arijay!
    One last question about these versions. Now, should i really go for a professional version or continue with the express edition 2005? As in , I want to know what difference does the MFC support have.
    Also, if I have to get a professional version, how much do i have to spend on it because I am a student and may not be able to spend much!

  14. #14
    Join Date
    Oct 2009
    Posts
    577

    Smile Re: MFC Class Wizard Problem

    Quote Originally Posted by Manchiraju View Post
    Now, should i really go for a professional version or continue with the express edition 2005? As in , I want to know what difference does the MFC support have.
    Also, if I have to get a professional version, how much do i have to spend on it because I am a student and may not be able to spend much!
    If you decide for the express edition you should go with VS2010 cause you get most support for those newest versions. Express editions have some restricted usage which shouldn't much bother you if you were not developing commercial applications. There is also a limited extent of the EE version mostly regarding team working or build options like building with static libraries which also shouldn't bother you much.

    If you go with an older version like VS2005 I would recommend to using standard or professional edition. You often can get it for little money at **** (though it is funny that older versions often were more expensive than younger ones).

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

    Re: MFC Class Wizard Problem

    Quote Originally Posted by Manchiraju View Post
    Thanks Arijay!
    One last question about these versions. Now, should i really go for a professional version or continue with the express edition 2005? As in , I want to know what difference does the MFC support have.
    Also, if I have to get a professional version, how much do i have to spend on it because I am a student and may not be able to spend much!
    To be honest, the Express edition isn't much good for C++ development. It lacks a resource editor and doesn't have MFC support. In my opinion, if you want to develop GUI apps in Windows using VC, it makes sense to use MFC or WTL. The express editions don't support any of these features.

    For academic pricing on the Professional Edition, search Bing or Google for:

    "Visual Studio 'professional edition' academic pricing"

    For US academic pricing, call 888.237.8376

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