Differences in Visual Studio 2015 and 2017 - Extract function

Hi everyone.
Sorry about placing the problem here, there’'s no typical topic for the IDE itself… anyhow
I’m using Visual Studio 2017 and have run into a halt with the IDE as the “Quickmenu: Extract function” doesn’t operate the same way as explained in lecture 22.
The options menu looks differnt in Ben’s version ( Visual Studio 2015?) and Ben have more available options to select in the course video.
I have checked Microsoft for expirmental addons but 2017 seems to have all options already added
.
Basically i can’t create the header-file in this lecture by using the quickmenu… I might do it manually but this feels like it can be more head ache down the road when the course refers to functions that has changed

Thanks in advance for any directions
/Magnus

Seems to be enabled by default for me. What do you see?

Thanks for replying.

Yes the menu show “Quick actions and refactoring” and in the submenu: Experimental: Extract function…
but using this it doesn’t create any header file in the header files directory… it creates something that looks like “main.cpp” inside the code… very weird…

I don’t know if i have missed installing anything but its hard to know as Ben is using 2015 version…
Options menu is different too. meaning it doesn’t have as many selectable features to enable/disable.

This is nog biggie but nevertheless it may be further down the road…

You don’t want it to create a header file, “main.h” is undersireable.

1 Like

OK, sorry i might have explained the problem incorrectly: The headerfile created in the course lecture is named “PlayGame.h” and this is what i try to do in my code and what i expected to be created when i used this quickfunction - not main.h

“main.cpp” is what it says - in my code - when i use this quick-funckton… hence why i don’t understand what i have missed / not configured correctly

EDIT: There is nothing created in the Headerfile -directory

What time frame? at 3:57 it says main.h

Ah yes… two different namings… PlayGame() call and the name is main.h in the headerfolder…
You’re correct.
Still it’s a bit confusing if a header-file - in this case - doesn’t mean anything essential…
Where i come from ( programming on Arduino) creating a header-file is very much important to make things work.

EDIT: I may have to clarify if someone else reads this and get’s stuck in the same brainfart is i have: The code is looking the same and will presumably do the same thing, it’s just that it differs from what is explained in the course lecture which to me is enough to block the brain from working as intended.

EDIT2: I did forgo the events as Ben is explaning later in the lecture that creating the main.h is undesirable… so
putting the cool hat on will do the trick i suppose.

Thank you DanM

I also just came across the exact same things you mentioned above. I am not sure why but I’m assuming Microsoft changed that feature in VS 2017 because so many people were having to delete the header file in VS 2015. I was confused as well…and a little frustrated. I tried a google search to see if I could change this feature in 2017 to be exactly like 2015, but it doesn’t seem to exist. So I guess we are just going to have to accept it. Hopefully when the time comes later in the course where we do want the header file to be created, someone will have posted an update or work around.

Thanks for commenting ronyrr64.
And yes, sligtly annoying i’d say, but the more i think about it my brain has rebooted and what DanM said earlier makes perfect sense and i actually answered my own question when referring to Arduino programming as this relies heavily on both C++ and Header files…

( What i meant was it’s probably a good thing they changed this in V.S 2017 and will probably make the use of header files less confusing)

Back to class now.

Cheers!