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.
6753BCFDE8E4D3679022FB2073E8C785DE8A89358621A1E9B5DA51E4DA6DE4EC
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.
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."
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."
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
b88e40e3e74ea2e7aa5b0ca1f176566a48f658ee4e35fe6793725c0a0627fb47
*********************************************************************************************
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
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 timeHi Quin. Thanks for mentioning this. The Like option should be available to all members now..