Author Topic: Visual Studio 2017  (Read 635 times)

0 Members and 1 Guest are viewing this topic.

Offline James C. Fuller

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 672
Visual Studio 2017
« on: March 03, 2017, 06:13:25 PM »

I installed the latest RC of Visual Studio 2017 community on my Win10 insider box.
I think I was misinformed on the inability to use it from a batch file.
It does not work exactly like all the previous versions but I was able to modify my batch file and tested a couple of bc9Basic Apps with no issues.
I also did a quick test with a CWindow/TCLib app and it came in smaller than with VS2015.

I'm going wait until the final release before I install it on my production box.

James


Offline James C. Fuller

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 672
Re: Visual Studio 2017
« Reply #1 on: March 08, 2017, 01:43:55 PM »
Installation of Visual Studio 2017 Community went smoothly.
I only installed Desktop development with C++
Not much testing done yet.
These are the batch files for setting up the command line Visual Studio 2017 Community environment.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat
  calls vcvarsall.bat with x86 parameter

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
  calls vcvarsall.bat with x64 parameter

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat

It appears this is added to global path
C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\

James

Offline James C. Fuller

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 672
Re: Visual Studio 2017
« Reply #2 on: March 28, 2017, 05:04:03 PM »

Robert Wishlaw the BCX help file maintainer, BCX Yahoo group moderator , and expert BCX coder wrote a utility to find the path to the Visual Studio 2017 batch files. These batch files set up the enviornment from the command line before compiling with cl.

The utility also highlights the COM abilities of BCX/bc9Basic. I personally do not use them much but they are available.
These 40  lines of basic  translate to 1200+ lines of "c" code which was compiled with the Visual Studio 2017 cl compiler.

Attached is the "c" source and the exe.

James

'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
'jcfuller note: The batch files this utilty displays:
'vcvars32.bat / vcvars64.bat
'call vcvarsall.bat with x86 or x64 argument respectively
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
 

$ONEXIT "VSC2017.BAT $FILE$ -m64 con"

GLOBAL str1$
GLOBAL strTargetPathx86$, SWorkx86$, SArgux86$
GLOBAL strTargetPathx64$, SWorkx64$, SArgux64$

  DIM objShell AS OBJECT
  SET objShell = CreateObject("Wscript.Shell")
    str1$ = objShell.SpecialFolders("AllUsersPrograms")
    strTargetPathx86$ = str1$  & "\Visual Studio 2017\Visual Studio Tools\VC\x86 Native Tools Command Prompt for VS 2017.lnk"
    strTargetPathx64$ = str1$  & "\Visual Studio 2017\Visual Studio Tools\VC\x64 Native Tools Command Prompt for VS 2017.lnk"
  SET objShell = NOTHING
  IF EXIST(strTargetPathx86$) THEN
     DIM objShell AS OBJECT
     SET objShell = CreateObject("Wscript.Shell")
     DIM objShortcut AS OBJECT
     SET objShortcut = objShell.CreateShortcut(strTargetPathx86$)
     str1$ = objShortcut.WorkingDirectory
     SWorkx86$ = ENC$(str1$)
     str1$ = objShortcut.Arguments
     SArgux86$ = REMAIN$(str1$, "/k ")
     SET objShortcut = NOTHING
     SET objShell = NOTHING
  END IF
  IF EXIST(strTargetPathx64$) THEN
     DIM objShell AS OBJECT
     SET objShell = CreateObject("Wscript.Shell")
     DIM objShortcut AS OBJECT
     SET objShortcut = objShell.CreateShortcut(strTargetPathx64$)
     str1$ = objShortcut.WorkingDirectory
     SWorkx64$ = ENC$(str1$)
     str1$ = objShortcut.Arguments
     SArgux64$ = REMAIN$(str1$, "/k ")
     SET objShortcut = NOTHING
     SET objShell = NOTHING
  END IF

PRINT "32 bit Working Directory ", SWorkx86$
PRINT "32 bit Arguments ", SArgux86$
PRINT "64 bit Working Directory ", SWorkx64$
PRINT "64 bit Arguments ", SArgux64$
Pause