VC++6.0 Add member function Wizard

This is a discussion on VC++6.0 Add member function Wizard within the C++ Programming forums, part of the General Programming Boards category; 1) I can never get the Add MemberFunction Wizard to add an operator= function correctly to a class. In File ...

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662

    VC++6.0 Add member function Wizard

    1) I can never get the Add MemberFunction Wizard to add an operator= function correctly to a class. In File view, I right click on the class name and select Add Member Function, and then fill in the function type and function declaration, but the Wizard only adds the skeleton definition to the .cpp file--it won't add the declaration to the .h file too, like it does with any other function I add. Why can't I get that to work?

    2) Does anybody use the Wizards, or is it easier to just ignore them?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,668
    The only wizards I use are for MFC and message maps - I've always done the raw C++ stuff myself.

    gg

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    162
    I use them for class member functions, and only occasionaly...its not that hard to type void name (void) twice, and then throw some brackets in....

  4. #4
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    Jamsan,

    Can you try creating a simple class and then try to add an operator= function to it? This is what I tried:

    I clicked on the Insert menu item, and then New Class. Then I typed in a new class name, say Cat, and that created the .cpp and .h files. Then, I right clicked on the class name in File View, and then I entered:

    Function type:

    Cat&

    Function declaration:

    operator=(Cat& a_Cat);

    (public check box checked)

    Then I clicked on OK. The skeleton class definition gets added to the .cpp file, but nothing gets added to the .h file. Is that what happens to you too?
    Last edited by 7stud; 04-05-2003 at 04:00 PM.

  5. #5
    Registered User
    Join Date
    Feb 2003
    Posts
    162
    hmm nope, sure doesnt. (add it to the .h)

  6. #6
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    Jamsan,

    I'm not clear what you're saying:

    1) Did your compiler add the declaration of the operator= function to the .h file?

    or

    2) nope, it sure doesn't add the function to the .h file when you try?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can you check what is wrong with this code
    By Ron in forum C++ Programming
    Replies: 4
    Last Post: 08-01-2008, 10:59 PM
  2. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Replies: 6
    Last Post: 04-27-2006, 10:55 AM
  5. member member function pointers
    By Bigbio2002 in forum C++ Programming
    Replies: 3
    Last Post: 12-04-2005, 04:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21