Main Menu

Recent posts

#1
Announcements / BCX Documentation Version 8.2....
Last post by Robert - March 21, 2025, 05:22:03 PM
BCX Documentation Version 8.2.6, March 21, 2025

REVISIONS
Quin
 ... updated, on the COM CREATEOBJECT page, the description of Example 4.

Kevin Diggins
 ... added Example 3: to the USING$ section.

 ... replaced the example in the BCX_DYNACALL statement section.

Robert Wishlaw
 ... revised 'Conway's Game of Life', replacing the "ALIVE" macro ASCII value of 2 with 38. ASCII 2 is a control char and Windows Terminal no longer prints ASCII control char glyphs.

 ... added WS_TABSTOP to the list of default arguments for the WinStyle parameter of the BCX_EDIT function.

 ... added WS_TABSTOP to the list of default arguments for the WinStyle parameter of the BCX_TREEVIEW function.

 ... added WS_TABSTOP to the list of default arguments for the WinStyle parameter of the BCX_RICHEDIT function.

 ... added WS_TABSTOP to the list of default arguments for the WinStyle parameter of the BCX_PROGRESSBAR function.

 ... revised the WinStyle and ExWinStyle parameter descriptions of the BCX_CONTROL function.

 ... in the += string concat operator section, Remarks: were removed regarding the incompatibility of the += concat operator with the colon [:] statement separator. Result: was added to the Example:.

 ... removed, from the LIB statement section, Example 2: as well as warnings regarding usability only in 32 bit compilations.

 ... removed, from the BCX_DYNACALL statement section, the Remarks: with example as well as warnings regarding usability only in 32 bit compilations.

SHA-256
6753BCFDE8E4D3679022FB2073E8C785DE8A89358621A1E9B5DA51E4DA6DE4EC
#2
Announcements / Re: BCX v8.2.6 is available fo...
Last post by MrBcx - March 21, 2025, 04:25:20 PM
Quote from: Vortex on March 21, 2025, 04:12:17 PMHi Kevin,

This one works without any issues :

DIM AnyType[3] AS INT_PTR
AnyType[0] = (INT_PTR) "This is %s %u."
AnyType[1] = (INT_PTR) "test"
AnyType[2] = (INT_PTR) 1
BCX_DYNACALL("msvcrt", "printf", 3, AnyType)

PRINT "All should be OK."

No need of the inline assembly code balancing the stack.

I suppose that's good to know but testing other functions that reside within
msvcrt.dll seems like a prudent thing to do before jumping in head first.


#3
Announcements / Re: BCX v8.2.6 is available fo...
Last post by Vortex - March 21, 2025, 04:12:17 PM
Hi Kevin,

This one works without any issues :

DIM AnyType[3] AS INT_PTR
AnyType[0] = (INT_PTR) "This is %s %u."
AnyType[1] = (INT_PTR) "test"
AnyType[2] = (INT_PTR) 1
BCX_DYNACALL("msvcrt", "printf", 3, AnyType)

PRINT "All should be OK."

No need of the inline assembly code balancing the stack.
#4
Announcements / Re: BCX v8.2.6 is available fo...
Last post by MrBcx - March 21, 2025, 03:05:59 PM
My enhancements are intended for accessing WinApi functions and similar using WINAPI (_stdcall) convention. 

The new runtimes accomplishe their work in a similar manner as when using the DECLARE statement but without
BCX needing to create individual typedefs for every function that we invoke dynamically.  That's also why the runtimes
don't need to differentiate the complex x64 calling convention vs _stdcall calling convention when compiling to 64-bit.

If one really needs to use the c-calling convention, the C_DECLARE statement will enable that.

Or it could be coded using inline c.

#5
Announcements / Re: BCX v8.2.6 is available fo...
Last post by Vortex - March 21, 2025, 02:38:04 PM
Hi Kevin,

Thanks for the new release. Let's assume that BCX_DYNACALL calls a C function. It's the caller's responsibility to balance the stack after calling a C function. Maybe, you could add a new function like BCX_DYNACALL_C for this purpose.

A quick example :

DIM AnyType[3] AS INT_PTR
AnyType[0] = (INT_PTR) "This is %s %u."
AnyType[1] = (INT_PTR) "test"
AnyType[2] = (INT_PTR) 1
BCX_DYNACALL("msvcrt", "printf", 3, AnyType)

$CCODE
 __asm
{
    add esp, 3*4
}
$CCODE

PRINT "All should be OK."

The code will crash as the stack is unbalanced after returning back from BCX_DynaCall :

        mov    eax, offset @1357
        mov    dword ptr [_AnyType+4H], eax
        mov    dword ptr [_AnyType+8H], 1
        push    offset _AnyType
        push    3             
        push    offset @1359 
        push    offset @1358 
        call    _BCX_DynaCallA
        add    esp, 16  <--- This line       
        add    esp, 12  <--- and this line
#6
Announcements / BCX v8.2.6 is available for do...
Last post by MrBcx - March 21, 2025, 09:25:53 AM
BCX 8.2.6 has been uploaded.

This update includes bug fixes and new features.

https://bcxbasiccoders.com/archives/YahooGroups/Bcx_Files_New/Bcx826.zip

SHA-256
b88e40e3e74ea2e7aa5b0ca1f176566a48f658ee4e35fe6793725c0a0627fb47
REVISIONS

*********************************************************************************************
2025/03/21       Changes in 8.2.6 from 8.2.5
*********************************************************************************************
Kevin Diggins  : Enhanced BCX_DYNACALL and LIB to compile with 64-bit and 32-bit executables.
                 All inline assembly has been replaced with pure C code and directives for
                 maximum compatibility with all popular Windows c/c++ compilers.
                 Both commands are limited to functions with no more than 16 arguments which
                 should be more than enough for any rationally designed function.  These
                 enhancements are mostly backward-compatible with existing BCX code.

Kevin Diggins  : The LIB statement can now be used in 64-bit and 32-bit executables.
                 FOR example, this one line of code will popup a Windows MessageBox:
                 MessageBox(LIB "user32", NULL, "Your Msg", "Your Title", MB_OK)
                 -----------^^^

Kevin Diggins  : BCX_DYNACALL() can now be used in 64-bit and 32-bit executables.
                 BCXHelp has the following example which only compiles with 32-bit:

                 DIM AnyType[4] AS INT
                 AnyType[0] = (INT) NULL
                 AnyType[1] = (INT) "Your Title"
                 AnyType[2] = (INT) "Your Msg"
                 AnyType[3] = (INT) MB_OK
                 BCX_DYNACALL("user32", "MessageBox", 4, AnyType)

                 When we replace INT with INT_PTR, it compiles in 32-bit and 64-bit.

                 DIM AnyType[4] AS INT_PTR    ' INT_PTR works for 32-bit and 64-bit executables
                 AnyType[0] = (INT_PTR) NULL
                 AnyType[1] = (INT_PTR) "Your Title"
                 AnyType[2] = (INT_PTR) "Your Msg"
                 AnyType[3] = (INT_PTR) MB_OK
                 BCX_DYNACALL("user32", "MessageBox", 4, AnyType)

Kevin Diggins  : Fixed "Me" keyword bug introduced during 8.2.5 WITH/ENDWITH refinements.

Kevin Diggins  : Refined the translation of WITH/ENDWITH statements (This might nail it!)

Kevin Diggins  : The 8.2.5 limitation involving the statement separator (:) and the string
                 concatenation operator (+=) has been removed. This means that BCX can now
                 correctly translate lines containing multiple statements.  For Example:
                         DIM A$ : A$ += "Yippie!" : PRINT A$ : PAUSE

Kevin Diggins  : Small enhancement to the USING$() function.  Zeros can now be used inside
                 the format string to LEFT pad the resulting string with zeros. Commonly
                 useful for formatting time and date strings but not limited to those.
                 SOME EXAMPLES:
                 
                 PRINT USING$("###.##", PI)        ' Normal, no LEFT padding occurs
                 PRINT USING$("  #.####", PI)      ' Explicit LEFT padding (spaces) 
                 PRINT USING$("000.000000", PI)    ' Pad 2 zeros on LEFT side of PI
                 PRINT USING$("0000.########", PI) ' Pad 3 zeros on LEFT side of PI

                 OUTPUT:

                 3.14
                   3.1416
                 003.141593
                 0003.14159265         

Kevin Diggins  : Replaced > internal < BCX function IsNumber() with IsNumberEx(), renaming
                 IsNumberEx() to IsDecimalNumber() and included more detections that
                 strengthen the reliabilty of IsDecimalNumber() and IsHexNumber() functions.

Kevin Diggins  : Added Intel C++ compiler detection

Kevin Diggins  : WS_TABSTOP added to 5 BCX GUI controls that lacked it, per Quin's request.

Kevin Diggins  : Ongoing formatting improvements to the source, output and runtime code

#7
Announcements / Re: BCX Forum Software Updated...
Last post by Jeff - March 21, 2025, 07:51:13 AM
Quote from: Quin on March 21, 2025, 07:16:58 AMAwesome, I like it! I can't figure out how to like posts yet, but I also just woke up and it looks like Jeff got it working, so it's likely user error and I'll get it in time :).
Hi Quin. Thanks for mentioning this. The Like option should be available to all members now.
#8
Announcements / Re: BCX Forum Software Updated...
Last post by Quin - March 21, 2025, 07:16:58 AM
Awesome, I like it! I can't figure out how to like posts yet, but I also just woke up and it looks like Jeff got it working, so it's likely user error and I'll get it in time :).
#9
Announcements / BCX Forum Software Updated.
Last post by MrBcx - March 20, 2025, 11:06:32 PM
Jeff completed the SMF forum updates a short while ago.

Things seems to be working well but if you encounter problems, please submit a Bug Report.

If you had Alerts and/Emails enabled in the previous version, you will need to go
through the boards that you want to follow and select whether you want forum alerts
and/or emails whenever a post appears on your boards of interest.  See the attached
screenshot is this sounds confusing to you.

#10
Off-Topic Discussions / Re: Unable to register on the ...
Last post by Quin - March 20, 2025, 03:34:58 PM
Awesome, thanks Jeff! I was thinking about requesting this soon.