Well José i would have preferred to ask these questions here
http://www.planetsquires.com/protect/forum/index.php?topic=4049.0, but registration is not possible as it seems.
First of all, congratulations for what you have done with WinFBX! I´m most interested in the Unicode string part (CWstr, CBstr) for FreeBASIC.
1.) My first question is, why two versions of wide strings? I read a post, where you stated you are using CBstr for COM - is CWstr not working for COM ?
2.) "sptr" and "vptr" do the same thing, i would have expected "sptr" to return a pointer to the data and "vptr" to return a pointer to the type - just like "strptr" and "varptr". Is this by intention or by error ?
3.) There is a problem with "LEFT", "RIGHT" and some other statements in FreeBASIC, maybe i found a solution for this.
PRIVATE FUNCTION Left OVERLOAD (BYREF cws AS CWSTR, BYVAL nChars AS INTEGER) byref as wstring
static s as cwstr
s = LEFT(**cws, nChars)
RETURN *cast(wstring ptr, *s)
END FUNCTION
Implementing this you may use "LEFT" (and others) in regular code just as usual (without the need of "**"). Do you see any problems here ?
4.) To my surprise the following code:
himage = loadimage(hinst, d, %IMAGE_BITMAP, 0, 0, %LR_DEFAULTCOLOR)
works for "DIM d AS STRING" AND for "DIM d AS CWstr" - how could that happen ?
"d" (the bitmaps resource name - STRING or CWstr) is passed: BYVAL NAME AS LPCSTR. I understand how this works for a STRING, but i don´t understand how this could work for a CWstr - but it definitely does (32 and 64 bit) while
himage = loadimage(hinst, STRPTR(d), %IMAGE_BITMAP, 0, 0, %LR_DEFAULTCOLOR)
works for a string, but not for a CWstr.
5.) "STRPTR" doesn´t work for a CWstr at all (compiler error), you must use "STRPTR(**d) or just *d, how could we make it accept "STRPTR(d)" ?
6.) having the exact same syntax for STRING (ANSI) and CWstr (Unicode) would make it possible to avoid multiple
#ifdef %unicode
dim d AS CWstr
#ELSE
dim d AS STRING
#ENDIF
and to have one
#ifdef %unicode
#define dstr CWstr
#ELSE
#define dstr STRING
#ENDIF
... and then ...
DIM d AS dstr
where "dstr" stands for "dynamic string" and could be used for ANSI and Unicode - if they only shared the same syntax...
Eager to hear your explanations and thoughts,
JK