XP Programming

Trying to get started in XP Programming and had to download the 2022 Visual Studio rather than 2019 of the XP Tutorial. In the tutorial it tells you to start a new project based upon the Windows Desktop Wizard. I don't see such a template as an option. I'd be happy to show what there is, but the list is enormous, and I cannot figure out where the templates are stored where I could copy the folder list and past here.

Has anyone else used 2022 and can point me to the correct template?

«1

Comments

  • BidmaronBidmaron Traveler

    Don't let the label on me as a newcomer fool you. I started with Campaign Cartographer back in the early 90s.

    JimP
  • MonsenMonsen Administrator 🖼️ 81 images Cartographer

    Have you installed the correct workloads in VS2022 (Should be the same as for 2019). The Windows Desktop Wizard should still be the correct template to use here, but the Dynamic-Link Library (DLL) template should give the same results.


  • BidmaronBidmaron Traveler

    Monsen, I am just going to try to use the XP project you provided, creating the root-level c:\cc3plus\ directory as you recommend. I followed your tutorial as much as possible in setting up VS2022, but there were some options for the project types that weren't named like in your tutorial. Bottom line - there is nothing named Windows Desktop Wizard, and I set up for almost everything that wasn't python, web, or clearly N/A material.

  • BidmaronBidmaron Traveler

    When you double click XP Template.vsix in VS20222, it bombs and says it cannot be installed.


  • BidmaronBidmaron Traveler

    I put the XP Template file into the CC3+ folder where I copied my CC3 install at the root c: level.

  • BidmaronBidmaron Traveler

    Then I double-clicked it to try to open it in VS2020, and that was the result.

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    edited April 2022

    Yea, that template file was built for visul studio 2019.

    Here is the version built for 2022


    For the record, here are my personal workload setup of 2022. I am pretty sure it is the 'Desktop Development with C++" that gives the Windows Desktop Wizard and Dynamic Link Library project types.


  • BidmaronBidmaron Traveler

    @Monsen Thanks. Now I have to remember how to generate the list you show above in VS. Very rusty on it because I haven't used it much since I was working on a Fantasy Grounds add-on a few years back. Most of the time I'm just using VBA these days right in the Office programs.

  • BidmaronBidmaron Traveler

    @Monsen And thank you very much for the VS2022 download!

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer

    That list is from the Visual Studio Installer. Should be an icon for it in your start menu, then just hit modify on your VS installation in the dialog to.

    Keep in mind that my list above is my actual installation though, I do more than just develop CC3+ add-ons, not everything there is needed for that.

  • BidmaronBidmaron Traveler

    I was able to find the almost hidden link (not a button) on VS2022 to modify the setup, and I added a bunch of stuff. One of them evidently did the trick because now the 'Windows Desktop Wizard' shows up. Back in business, and I'll try your 2022-compatible post above next. Thanks, Monsen.

  • BidmaronBidmaron Traveler

    @Monsen Now that I finally have vS2022 set up correctly, I'm trying to follow the Macro tutorial start-to-stop. On the first page you say to set the Platform Toolset to Visual Studio 2017, but the only option I have is Visual Studio 2022. The reason for selecting 2017 you say is that CC3+ is built in 2017 and that choosing something else would require a library to be installed. You have been super in helping here and my DFX/DRW thread, but where would I find the library I will need, sir?

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    edited April 2022

    It really only matters if you wish to distribute your XP. The reason for sticking with the same version as CC3+ itself uses is that users are guaranteed to have the correct libraries installed. I do believe that Joe switched over to VS 2019 for newer builds anyway, and later versions of the installable runtimes actually provide support for all newer versions, making it matter even less, so you should be able to just use the 2022 toolset without issues.

    That said, to install the additional toolsets, all you have to do is to go back into the visual studio installer and modifying your installation, and under the C++ desktop development you can install the MSVC 1.42 for 2019 support, and MSVC 1.41 for 2017 support. You can see these options in my screenshot above, in the list to the far right of the dialog...

    I should update that article with 2022 now being the current version. There are no real differences, but it can be annoying when the steps in the article doesn't match up 100% with the actual product. Everything when it comes to the actual code in the tutorials will be 100% identical though, it's just some minor changes to the setup.

    JimP
  • BidmaronBidmaron Traveler

    @Monsen OK, this is not a big deal because I am just pasting over the Part I code to continue with Part II of your tutorial, but the XP Template you posted above runs and installs just fine, but I cannot locate it when I go to create a new project. Below is the 2022 window to create a new project, and it shows I have all the templates in the various filters, but I can't find anything labeled logically for CC3+ XP development in the enormously long list of templates when you don't have any filtering.

    So, I'm sure I'm just rocking out again, but in case you update the tutorial at some point, I'm afraid you're going to have to be more explicit in your instructions for how to use the XP Template.

    Not asking for any help here, because I'm just pasting over the setup I used for the first part of the tutorial, but in the FWIW category.....

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer

    Filters doesn't work with custom templates unfortunately, but it should be easy to locate just by typing cc3 in the search box.


    I'll mention that when I rewrite the tutorial. That first part was written before I made the template at all, so the mentions of it was just edited in later.



    JimP
  • BidmaronBidmaron Traveler

    Wow, that brought it right up. But if you scroll through the giant list, I swear it's not there. I went through the whole list twice backwards and forwards looking for it. I should have guessed it would be CC3 something or other.

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer

    It should be there, but it seems like those templates are ordered by the order you installed things in. Visual Studio also doesn't support filters for custom templates, so it will only show up if all filters are cleared, trying to specify a language or platform will always exclude it. For me, it appears as the second to last one in a very long list.

    I never scroll through that entire list though, it's a hopeless way of finding anything. I deliberately included both CC3+ and Campaign Cartographer 3+ in the template name/description so it should be easy to search for.

  • BidmaronBidmaron Traveler

    Oh, it comes right up if you put in CC3, but I figured I could just scroll through and find it the old-fashioned way since I wasn't sure of the name of it. Thought I had done something wrong on the install again. All good, sir. Thanks.

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer

    It should be visible by just scrolling too. I was probably not clear enough above, but my comment to it being second to last in the list was when I just started a new instance of VS and just scrolled, not searched. I was just pointing out that even if it clearly should be there, looking through that entire list is a very undesirable experience..

  • BidmaronBidmaron Traveler

    My screenshot was the last four items in my list when it is unfiltered and no search text. It must be there somewhere, because it comes right up when you search for CC3, but I'll be danged if I can find it manually. (and it is no fun going through the long list)

  • BidmaronBidmaron Traveler

    @Monsen I think there is something amiss in the 2022 Template. The line

    #include <windows.h>

    says that it cannot load "windows.h".

    Consequently, 'NULL' isn't even recognized by the compiler.

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer

    The template works perfectly for me, so it sounds like there may still be something missing in your install. I am not sure exactly what provides windows.h, I would expect one of the windows SDK's, but I thought at least one of those were included with the C++ desktop development workload. The article was written based on a clean setup of VS 2019, but it might be some minor changes for 2022 that needs to be checked. I need to set up a clean install myself to test it out. I never needed to set up anything special myself when I switched from 2019 to 2022, but I set up a rather complete workload for other purposes, so I may have ended up with everything simply because of that.

    I'll see if I can get a clean install up and running and update the article.

  • BidmaronBidmaron Traveler

    That's okay. I can edit the file for the first tutorial (which works fine with the include windows.h) to add the stuff from the latter tutorials. No big deal. Just thought it may have been some kind of prefixing issue in the template that would need fixing when you do update the tutorials.

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer

    I've edited the first tutorial now, updated it for VS 2022 and tested it on both Windows 10 and 11, so everything should be correct there.

    As for the part 2 project, seems like there was an error there where the project no longer contained the references to the XP toolkit, and was otherwise reverted to default values, which is why the includes didn't work. The project needed to be changed to use an installed SDK, and the XP references put back in. I've uploaded a fixed version now.

    I've also made a minor change to my CC3+ XP template, now it should default to the latest installed SDK instead of targeting a specific version. You can download the new one using the same link as before.

    JimP
  • BidmaronBidmaron Traveler

    Wow, Monsen. Will let you know if I find any other difficulties going forward. I had it working just putting code into Part 1 project but will switch over to your modified template.

  • BidmaronBidmaron Traveler

    @Monsen I switched to the new template. You have it set to use the 2019 Visual Studio to build, which someone just starting probably won't have. Here's my error screen:

    Not a huge deal since if you do what it says, it builds just fine, but I promised I'd let you know if I see any other issues going forward.

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    edited April 2022

    Thanks, but the use of the v1.42 toolset is deliberate. It is documented in the installation instructions. I use it deliberately since that is what CC3+ itself is built under, so using that ensures that the anyone using the XP won't have to update their installed Visual C++ runtime, but rather just have it work out of the box.

  • BidmaronBidmaron Traveler

    OH, sorry, didn't re-read through Part I. Wise because unless someone had installed 2022 on their machine it would be possible to need a tool kit to run your XP, and that is your point. Will go back and re-do that part.

  • BidmaronBidmaron Traveler
    edited April 2022

    In order to get the Part 2 tutorial pentagram code to compile, I had to add "#include <cmath>" to the Main.h header file. Without that I would get 7 errors associated with sqrt and pow calls.

Sign In or Register to comment.