7 Replies Latest reply on May 21, 2015 1:13 AM by LeoTaro

    Mac Developer Lost in Visual Studio Land

    Doug Habben Level 1

      I have been doing plug-ins for Mac since version 6 (not CS6) with CodeWarrior and Xcode.

      I would like to port some CC versions to Windows. I rarely use a Windows machine and have no experience with Visual Studio so any and all suggestions are welcomed.

       

      Here is what I have tried so far (using CC2014 SDK MenuPlay sample project):

      Microsoft Visual C++ 2010 Express - Build fails with error RC1015: cannot open include file 'afxres.h'

       

      Microsoft Visual Studio 2012 - The only download I could find is "Microsoft Visual C++ Redistributable Packages for Visual Studio 2012 Update 4" which only gives me three command prompt versions (VS2012 ARM Cross Tools, VS2012 x64 Cross Tools and VS2012 x86 Native Tools). Command Prompt - ugh - lost in the weeds with that.

       

      VS Express 2013 for Desktop - error MSB8020: Platform Toolset v110 not found.

      When I update the Platform Toolset in Properties to the v120 version in VS2013 the build is successful but the plug-in fails to load (with error msg) when Illustrator is launched.

       

      Questions:

      Can I add the v110 Toolset to VS2013?

      Or, is there a full version VS2012 out there somewhere for free?

      What are the .bsc and .ilk files created along with the .aip file in the Output folder?

      What VS version (free or not) works best for CC plugin development?

       

      Cheers and Thanks.

      -dh

        • 1. Re: Mac Developer Lost in Visual Studio Land
          LeoTaro Level 4

          You should be OK with Visual C++ 2010 Express. The error about afxres.h is because the Express version doesn't include the MFC headers and libraries. The Illustrator SDK samples don't actually use any MFC features. Try creating a file called afxres.h in the samplecode/common/includes folder and add this line to the file:

           

          #include "windows.h"

           

          The .bsc file is a file that enables you to browse symbol references from within the Visual Studio project. The .ilk file is an incremental link file that speeds up the linking process by not doing a full link every time. You don't need either file to run the plugin.

          • 2. Re: Mac Developer Lost in Visual Studio Land
            Doug Habben Level 1

            Thanks Leo. Tried that but to no avail. After adding the dummy afxres.h file, the error was can't find winres.h.

             

            I did find and install a copy of Visual Studio Express 2012 that has the v110 Toolset. The build completed successfully after I copied the afxres.h file from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include folder into the SDK samplecode\common\win folder, however, Illustrator encounters a problem loading it when launching.

             

            So, kinda stuck.

            • 3. Re: Mac Developer Lost in Visual Studio Land
              LeoTaro Level 4

              I haven't built the samples for a while. I just downloaded the latest SDK and tried to build the MenuPlay sample on a machine that has only Visual C++ 2010 Express. The first error I got was:

               

              error MSB8008: Specified platform toolset (v110) is not installed or invalid.

               

              This is because the projects are now generated with VC 2012. To fix this, I right clicked on the MenuPlay project in Visual Studio and selected Properties. Then in Configuration Properties | General, I change Platform Toolset from v110 to v100 (the 2010 toolset). I then got the error about not finding afxres.h. I then added the dummy afxres.h to the samplecode/common/includes folder and it built ok.

               

              Not sure where your winres.h error is coming from as it is not in any of the samplecode. Are you sure you didn't get this error in VC 2010 after copying the VC2012 afxres.h to the includes folder?

               

              If VC 2012 Express includes the MFC headers, you shouldn't need to copy the afxres.h to the includes folder. What error do you get in Illustrator when loading the plugin you managed to build using VC 2012?

              • 4. Re: Mac Developer Lost in Visual Studio Land
                Doug Habben Level 1

                #include winres.h is in afxres.h inside #ifdef RC_INVOKED

                 

                I had, what I thought was, a clever idea - use the first CC SDK (not the 2014 release). It uses the v100 Toolset.

                So, open in Visual C++ 2010 Express and build - It found afxres.h (in the 2010 app VC\atlmfc\include folder) but still gave can't open winres.h error.

                Added winres.h to solution file list - can't open winres.h error again.

                Copied the winres.h code into afxres.h and commented out #include winres.h and the build was successful but still got the generic "Problem Loading Plugin" error on Illustrator launch.

                I am running AI_CC2014 so I guess it's possible plugins built with the earlier SDK are not compatible with CC2014 (do you know?).

                 

                Did your successful build load in AI?

                • 5. Re: Mac Developer Lost in Visual Studio Land
                  LeoTaro Level 4

                  My version of VC++ 2010 Express does not include any of the MFC headers. I don't have a VC\atlmfc folder in my VC 2010 folder.

                   

                  If you have the MFC headers in whichever version you are using (2010 or 2012) you shouldn't create a dummy afxres.h file in the samplecode/common/includes folder. If you don't have the MFC headers then creating a dummy afxres.h file that just includes windows.h works for me.

                   

                  As you could build the plugin in VC 2012, you are probably better off sticking with that until you get things working. Did you build the 64 bit version of the plugin? The default platform is Win32, which won't work in CC 2014 as it is 64 bit only. Change the dropdown in the toolbar at the top from Win32 to x64. The plugin will appear in samplecode/output/win/x64.

                   

                  As for using earlier versions of the SDK, I always use the first release of the CC SDK as this will work with all versions of CC and 2014 and I haven't seen any new features in any of the later releases that I would want to use. If you use a later version of the SDK, then the plugin will not work with any CC or 2014 versions released before the SDK. This is a problem if you have users who don't always update to the latest versions.

                  • 6. Re: Mac Developer Lost in Visual Studio Land
                    Doug Habben Level 1

                    Success!

                    The crucial information - "The default platform is Win32, which won't work in CC 2014 as it is 64 bit only"  - duh.

                    Built with Express 2012 and CC vers. 17 SDK (not CC2014).

                    The x64 platform option is not available in the toolbar drop down menu, but can be set to x64 in the Configuration Manager, Project contexts, Platform menu.

                    Still had to add afxres.h to the SDK common\win folder with #include winres.h commented out.

                     

                    So, at least I have something to get started testing with. Cannot thank you enough, LeoTaro.

                     

                    Do you know if the x64 build will run in AICC v 17? I have only CC2014 (v18).

                    • 7. Re: Mac Developer Lost in Visual Studio Land
                      LeoTaro Level 4

                      Glad you got it working. If you build with the CC 17 SDK, it should run in both CC and 2014. Don't forget CC has 32 and 64 bit versions so you also need to build a win32 version if you want to support 32 bit CC.