Recent Posts

Pages: 1 2 3 4 5 6 7 8 9 10
1
Discussion / Re: Visual Studio 2017
« Last post by James C. Fuller 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




2
bc9Basic / Re: Afx National Language Support
« Last post by James C. Fuller on March 27, 2017, 09:08:40 PM »
The results from above:

AfxGetLocaleAbbrevDayName(1)                -> Mon
AfxGetLocaleAbbrevMonthName(9)              -> Sep
AfxGetLocaleCurrencySymbol()                -> $
AfxGetLocaleDayName(1)                      -> Monday
AfxGetLocaleDecimalSeparator()              -> .
AfxGetLocaleDigitsGrouping()                -> 3;0
AfxGetLocaleEnglishCountryName()            -> United States
AfxGetLocaleEnglishCurrencyName()           -> US Dollar
AfxGetLocaleEnglishDisplayName()            -> English (United States)
AfxGetLocaleEnglishLanguageName()           -> English
AfxGetLocaleInternationalMonetarySymbol()   -> USD
AfxGetLocaleISO639LanguageName()            -> en
AfxGetLocaleISO639LanguageName2()           -> eng
AfxGetLocaleISO3166CountryName()            -> US
AfxGetLocaleISO3166CountryName2()           -> USA
AfxGetLocaleListItemsSeparator()            -> ,
AfxGetLocaleLongDateFormatString()          -> dddd, MMMM d, yyyy
AfxGetLocaleMonetaryDecimalSeparator()      -> .
AfxGetLocaleMonetaryGrouping()              -> 3;0
AfxGetLocaleMonetaryThousandsSeparator()    -> ,
AfxGetLocaleMonthDayFormatString()          -> MMMM d
AfxGetLocaleMonthName(9)                    -> September
AfxGetLocaleName()                          -> en-US
AfxGetLocaleNanString()                     -> NaN
AfxGetLocaleNativeCountryName()             -> United States
AfxGetLocaleNativeCurrencyName()            -> US Dollar
AfxGetLocaleNativeDigits()                  -> 0123456789
AfxGetLocaleNativeDisplayName()             -> English (United States)
AfxGetLocaleNativeLanguageName()            -> English
AfxGetLocaleNegativeInfinityString()        -> -
AfxGetLocaleNegativeSign()                  -> -
AfxGetLocaleOpenTypeLanguageTag()           -> ENG
AfxGetLocalePermilleSymbol()                -> No console display
AfxGetLocalePositiveInfinityString()        -> No console display
AfxGetLocalePositiveSign()                  ->
AfxGetLocaleScriptsList()                   -> Latn;
AfxGetLocaleShortDateFormatString()         -> M/d/yyyy
AfxGetLocaleShortestDayName(6)              -> Sa
AfxGetLocaleShortTimeFormatString()         -> h:mm tt
AfxGetLocaleSortName()                      -> Default
AfxGetLocaleThousandsSeparator()            -> ,
AfxGetLocaleDateSeparator()                 -> /
AfxGetLocaleTimeFormatString()              -> h:mm:ss tt
AfxGetLocaleTimeSeparator()                 -> :
AfxGetLocaleYearMonthFormatString()         -> MMMM yyyy
AfxGetLocalizedCountryName()                -> United States
AfxGetLocalizedDisplayName()                -> English (United States)
AfxGetLocalizedLanguageName()               -> English (United States)
AfxGetSortLocale()                          -> en-US
3
bc9Basic / Afx National Language Support
« Last post by James C. Fuller on March 27, 2017, 09:07:37 PM »

I've been retesting code with my latest TCLib and VS Community 2017 so I thought I'd post some of the code.
James


'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
'Afx National Language Support
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
$NOMAIN
$CPP
$ONEXIT "ULEX.EXE $FILE$.CPP TCHARXLATER_VC.TXT"
$ONEXIT "TCLIB.BAT $FILE$"
'==============================================================================
$USE USE_AfxGetLocaleAbbrevDayName USE_AfxGetLocaleAbbrevMonthName USE_AfxGetLocaleCurrencySymbol
$USE USE_AfxGetLocaleDayName USE_AfxGetLocaleDecimalSeparator USE_AfxGetLocaleDigitsGrouping
$USE USE_AfxGetLocaleEnglishCountryName USE_AfxGetLocaleEnglishCurrencyName USE_AfxGetLocaleEnglishDisplayName
$USE USE_AfxGetLocaleEnglishLanguageName USE_AfxGetLocaleInternationalMonetarySymbol
$USE USE_AfxGetLocaleISO639LanguageName USE_AfxGetLocaleISO639LanguageName2 USE_AfxGetLocaleISO3166CountryName
$USE USE_AfxGetLocaleISO3166CountryName2 USE_AfxGetLocaleListItemsSeparator USE_AfxGetLocaleLongDateFormatString
$USE USE_AfxGetLocaleMonetaryDecimalSeparator USE_AfxGetLocaleMonetaryGrouping USE_AfxGetLocaleMonetaryThousandsSeparator
$USE USE_AfxGetLocaleMonthDayFormatString USE_AfxGetLocaleMonthName USE_AfxGetLocaleName
$USE USE_AfxGetLocaleNanString USE_AfxGetLocaleNativeCountryName USE_AfxGetLocaleNativeCurrencyName
$USE USE_AfxGetLocaleNativeDigits USE_AfxGetLocaleNativeDisplayName USE_AfxGetLocaleNativeLanguageName
$USE USE_AfxGetLocaleNegativeInfinityString USE_AfxGetLocaleNegativeSign USE_AfxGetLocaleOpenTypeLanguageTag
$USE USE_AfxGetLocalePermilleSymbol USE_AfxGetLocalePositiveInfinityString USE_AfxGetLocalePositiveSign
$USE USE_AfxGetLocaleScriptsList USE_AfxGetLocaleShortDateFormatString USE_AfxGetLocaleShortestDayName
$USE USE_AfxGetLocaleShortTimeFormatString USE_AfxGetLocaleSortName USE_AfxGetLocaleThousandsSeparator
$USE USE_AfxGetLocaleDateSeparator USE_AfxGetLocaleTimeFormatString USE_AfxGetLocaleTimeSeparator
$USE USE_AfxGetLocaleYearMonthFormatString USE_AfxGetLocalizedCountryName USE_AfxGetLocalizedDisplayName
$USE USE_AfxGetLocalizedLanguageName USE_AfxGetSortLocale
$Include <Afx/AfxNls.bi>
'==============================================================================
Function main()
    Dim s$
    ? "AfxGetLocaleAbbrevDayName(1)                 -> ";AfxGetLocaleAbbrevDayName$(1)
    ? "AfxGetLocaleAbbrevMonthName(9)               -> ";AfxGetLocaleAbbrevMonthName$(9)
    ? "AfxGetLocaleCurrencySymbol()                 -> ";AfxGetLocaleCurrencySymbol$()
    ? "AfxGetLocaleDayName(1)                       -> ";AfxGetLocaleDayName$(1)
    ? "AfxGetLocaleDecimalSeparator()               -> ";AfxGetLocaleDecimalSeparator$()
    ? "AfxGetLocaleDigitsGrouping()                 -> ";AfxGetLocaleDigitsGrouping$()
    ? "AfxGetLocaleEnglishCountryName()             -> ";AfxGetLocaleEnglishCountryName$()
    ? "AfxGetLocaleEnglishCurrencyName()            -> ";AfxGetLocaleEnglishCurrencyName$()             
    ? "AfxGetLocaleEnglishDisplayName()             -> ";AfxGetLocaleEnglishDisplayName$()
    ? "AfxGetLocaleEnglishLanguageName()            -> ";AfxGetLocaleEnglishLanguageName$()
    ? "AfxGetLocaleInternationalMonetarySymbol()    -> ";AfxGetLocaleInternationalMonetarySymbol$()
    ? "AfxGetLocaleISO639LanguageName()             -> ";AfxGetLocaleISO639LanguageName$()
    ? "AfxGetLocaleISO639LanguageName2()            -> ";AfxGetLocaleISO639LanguageName2$()
    ? "AfxGetLocaleISO3166CountryName()             -> ";AfxGetLocaleISO3166CountryName$()
    ? "AfxGetLocaleISO3166CountryName2()            -> ";AfxGetLocaleISO3166CountryName2$()
    ? "AfxGetLocaleListItemsSeparator()             -> ";AfxGetLocaleListItemsSeparator$()
    ? "AfxGetLocaleLongDateFormatString()           -> ";AfxGetLocaleLongDateFormatString$()
    ? "AfxGetLocaleMonetaryDecimalSeparator()       -> ";AfxGetLocaleMonetaryDecimalSeparator$()
    ? "AfxGetLocaleMonetaryGrouping()               -> ";AfxGetLocaleMonetaryGrouping$()
    ? "AfxGetLocaleMonetaryThousandsSeparator()     -> ";AfxGetLocaleMonetaryThousandsSeparator$()
    ? "AfxGetLocaleMonthDayFormatString()           -> ";AfxGetLocaleMonthDayFormatString$()
    ? "AfxGetLocaleMonthName(9)                     -> ";AfxGetLocaleMonthName$(9)
    ? "AfxGetLocaleName()                           -> ";AfxGetLocaleName$()
    ? "AfxGetLocaleNanString()                      -> ";AfxGetLocaleNanString$()
    ? "AfxGetLocaleNativeCountryName()              -> ";AfxGetLocaleNativeCountryName$()
    ? "AfxGetLocaleNativeCurrencyName()             -> ";AfxGetLocaleNativeCurrencyName$()
    ? "AfxGetLocaleNativeDigits()                   -> ";AfxGetLocaleNativeDigits$()
    ? "AfxGetLocaleNativeDisplayName()              -> ";AfxGetLocaleNativeDisplayName$()
    ? "AfxGetLocaleNativeLanguageName()             -> ";AfxGetLocaleNativeLanguageName$()
    ? "AfxGetLocaleNegativeInfinityString()         -> ";AfxGetLocaleNegativeInfinityString$()
    ? "AfxGetLocaleNegativeSign()                   -> ";AfxGetLocaleNegativeSign$()
    ? "AfxGetLocaleOpenTypeLanguageTag()            -> ";AfxGetLocaleOpenTypeLanguageTag$()
    'this will not print to the console but it will show in a MessageBox
    ? "AfxGetLocalePermilleSymbol()                 -> ";"No console display"
    's$ = AfxGetLocalePermilleSymbol()
    'MsgBox s$,"AfxGetLocalePermilleSymbol",MB_OK
    'this will not print to the console but it will show in a MessageBox
    ? "AfxGetLocalePositiveInfinityString()         -> ";"No console display"
    's$ = AfxGetLocalePositiveInfinityString()
    'MsgBox s$,"AfxGetLocalePositiveInfinityString",MB_OK
   
    'the following does not  return a "+" as the ms documentation indicates
    ? "AfxGetLocalePositiveSign()                   -> ";AfxGetLocalePositiveSign$()
    ? "AfxGetLocaleScriptsList()                    -> ";AfxGetLocaleScriptsList$()
    ? "AfxGetLocaleShortDateFormatString()          -> ";AfxGetLocaleShortDateFormatString$()
    ? "AfxGetLocaleShortestDayName(6)               -> ";AfxGetLocaleShortestDayName$(6)
    ? "AfxGetLocaleShortTimeFormatString()          -> ";AfxGetLocaleShortTimeFormatString$()
    ? "AfxGetLocaleSortName()                       -> ";AfxGetLocaleSortName$()
    ? "AfxGetLocaleThousandsSeparator()             -> ";AfxGetLocaleThousandsSeparator$() 
    ? "AfxGetLocaleDateSeparator()                  -> ";AfxGetLocaleDateSeparator$()
    ? "AfxGetLocaleTimeFormatString()               -> ";AfxGetLocaleTimeFormatString$()
    ? "AfxGetLocaleTimeSeparator()                  -> ";AfxGetLocaleTimeSeparator$()
    ? "AfxGetLocaleYearMonthFormatString()          -> ";AfxGetLocaleYearMonthFormatString$()
    ? "AfxGetLocalizedCountryName()                 -> ";AfxGetLocalizedCountryName$()
    ? "AfxGetLocalizedDisplayName()                 -> ";AfxGetLocalizedDisplayName$()
    ? "AfxGetLocalizedLanguageName()                -> ";AfxGetLocalizedLanguageName$()
    ? "AfxGetSortLocale()                           -> ";AfxGetSortLocale$()

    Pause
   
End Function



4
Discussion / Re: TCLib update for Patrice
« Last post by James C. Fuller on March 26, 2017, 07:32:59 PM »
Thanks Patrice,
  I realize now why you were having problems with rand and srand as I found issues with my own work.
I assume one of your included files:
  #include <gl/GL.h>
  #include <gl/GLU.h>
is pulling in <stdlib.h> or one of the other msvcrt include files.

I had done a lot of successful testing originally with my port of José's CWindow and Afx framework but when I tried with my latest version of TCLib I had a number of redefinition errors.
I was including:
   #include <psapi.h>
   #include <Shlobj.h>
   #include <KnownFolders.h>
   #include <shlwapi.h>
   #include <commctrl.h>
   #include <uxtheme.h>
and at least one of them is pulling in msvcrt include files.

I write all my bc9Basic code as ansi. I then parse the c++ translated code with the ULEX utility which does all the transformations. I can name the library function tcl_rand and translate the source "rand" call to tcl_rand on the fly.
I am scratching my head though as only a few are a causing problems.

James


5
Discussion / Re: TCLib update for Patrice
« Last post by Patrice Terrier on March 25, 2017, 05:13:40 PM »
James, Fred,

I have attached the latest Visual Studio 2015/2017 TCLIB version of my 64-bit OpenGL plugins
to this post
C++bbp_plugins64.zip

The smallest dll is only 13 Kb.
6
Discussion / Re: TCLib update for Patrice
« Last post by Patrice Terrier on March 21, 2017, 02:21:47 PM »
James--

I have seen it already, but what i am looking for is a replacement for the PowerBASIC statement "AS ANY"
without using va_list


Currently i am doing this to use swprintf with long, and i must have another function for float, double, etc.
Code: [Select]
#define long_proc_c typedef long (__cdecl *zProc)

HMODULE MSVCRT() {
    static HMODULE hModule;
    if (hModule == 0) { hModule = LoadLibrary(L"MSVCRT"); }
    return hModule;
}

long long_swprintf(OUT WCHAR* buffer, IN WCHAR* format, IN long N) {
    long nRet = -1; // Error
    HMODULE hModule = MSVCRT();
    if (hModule) {
        long_proc_c (WCHAR*, WCHAR*, long);
        zProc hProc = (zProc)GetProcAddress(hModule, "swprintf");
        if (hProc) { nRet = hProc(buffer, format, N); }
    }
    return nRet;
}
7
Discussion / Re: TCLib update for Patrice
« Last post by James C. Fuller on March 21, 2017, 11:11:18 AM »
Patrice,
  Take a look at the TCLib\stdio.h file.

James
8
Discussion / Re: TCLib update for Patrice
« Last post by Patrice Terrier on March 21, 2017, 11:03:06 AM »
So far i have been able to create my smallest OpenGL 64-bit plugin, only 13 Kb.

And i was able to reduce the size of my PNGanim project from 140 Kb down to 60 Kb, using GetprocAdress to access directly to MSVCRT, the only thing that is causing me havoc, is when there are multiple optional parameters like for swprintf, and i don't know the syntax to use to create the prototype to use the "...".

9
Windows API Headers / Re: HSHELL_MONITORCHANGED
« Last post by José Roca on March 21, 2017, 04:38:54 AM »
Thanks. I have added it to the include file.
10
Windows API Headers / HSHELL_MONITORCHANGED
« Last post by Pierre Bellisle on March 21, 2017, 01:01:08 AM »
Hola José,

I was in need for this...  :-)

#if(_WIN32_WINNT >= 0x0602)
#define HSHELL_MONITORCHANGED 16
#endif /* _WIN32_WINNT >= 0x0602 */

%HSHELL_MONITORCHANGED = 16&

Jose\Windows API Headers\3.1.07\WinUser.inc

Related to RegisterShellHookWindow()

Take care,
Pierre
Pages: 1 2 3 4 5 6 7 8 9 10