PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5

Author Topic: WinFBX Version 1.0  (Read 6806 times)

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3087
    • Jos
Re: WinFBX Version 1.0
« Reply #45 on: April 02, 2018, 08:19:57 AM »

Paul has moved the forum to another server and some things have become corrupted.

Meanwhile, you can download it from GitHub.
https://github.com/JoseRoca/WinFBX

Eros Olmi

  • FireFly3 Registered User
  • Little Newbie FireFly
  • *
  • Posts: 17
    • www.thinbasic.com
Re: WinFBX Version 1.0
« Reply #46 on: April 02, 2018, 08:42:12 AM »

Thanks Jose.
Yes I got from github.

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8558
  • Windows 10
    • PlanetSquires Software
Re: WinFBX Version 1.0
« Reply #47 on: April 02, 2018, 10:07:53 AM »

Hmmm... that's too bad with the corrupted files. Just when I thought everything was moving over okay from the old server.  :(

I knew I was having trouble with the avatars but I didn't realize zip files might be affected. It seems you will need to re-upload your personal avatars.

Looks like FileZilla (by default) treats filenames with no extensions as ASCII files rather than binary. Therefore when uploaded to the new forum the line encodings of attachments were affected. I am attempting to redownload from old site and reupload. Hopefully it can be fixed.
« Last Edit: April 02, 2018, 12:56:49 PM by Paul Squires »
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3087
    • Jos
Re: WinFBX Version 1.0
« Reply #48 on: April 02, 2018, 01:19:06 PM »

You have fallen in the same trap that I did several years ago.

See: http://www.jose.it-berater.org/smfforum/index.php?topic=4183.msg14552#msg14552
« Last Edit: April 02, 2018, 02:14:04 PM by Josť Roca »
Logged

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8558
  • Windows 10
    • PlanetSquires Software
Re: WinFBX Version 1.0
« Reply #49 on: April 02, 2018, 01:27:09 PM »

I most certainly did! Luckily I have been able to get it all corrected. The only issue is now in posts where your name was (with an accent) it looks like the message got truncated at the accent character.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3087
    • Jos
Re: WinFBX Version 1.0
« Reply #50 on: May 11, 2018, 04:40:32 PM »

Modified the AfxStrLSet, AfxStrRset and AfxStrCSet functions because they GPFed with the 64 bit compiler.

Code: [Select]
' ========================================================================================
' Returns a string containing a left-justified (padded) string.
' If the optional parameter wszPadCharacter not specified, the function pads the string with
' space characters to the left. Otherwise, the function pads the string with the first
' character of wszPadCharacter
' Example: DIM cws AS CWSTR = AfxStrLSet("FreeBasic", 20, "*")
' ========================================================================================
PRIVATE FUNCTION AfxStrLSet (BYREF wszMainStr AS CONST WSTRING, BYVAL nStringLength AS LONG, BYREF wszPadCharacter AS WSTRING = " ") AS CWSTR
   DIM cws AS CWSTR = WSTRING(nStringLength, wszPadCharacter)
   MID(**cws, 1, LEN(wszMainStr)) = wszMainStr
   RETURN cws
END FUNCTION
' ========================================================================================

' ========================================================================================
' Returns a string containing a right-justified (padded) string.
' If the optional parameter wszPadCharacter not specified, the function pads the string with
' space characters to the left. Otherwise, the function pads the string with the first
' character of wszPadCharacter.
' Example: DIM cws AS CWSTR = AfxStrRSet("FreeBasic", 20, "*")
' ========================================================================================
PRIVATE FUNCTION AfxStrRSet (BYREF wszMainStr AS CONST WSTRING, BYVAL nStringLength AS LONG, BYREF wszPadCharacter AS WSTRING = " ") AS CWSTR
   IF LEN(wszMainStr) > nStringLength THEN RETURN LEFT(wszMainStr, nStringLength)
   DIM cws AS CWSTR = WSTRING(nStringLength, wszPadCharacter)
   MID(**cws, nStringLength - LEN(wszMainStr) + 1, LEN(wszMainStr)) = wszMainStr
   RETURN cws
END FUNCTION
' ========================================================================================

' ========================================================================================
' Returns a string containing a centered (padded) string.
' If the optional parameter wszPadCharacter not specified, the function pads the string with
' space characters to the left. Otherwise, the function pads the string with the first
' character of wszPadCharacter.
' Example: DIM cws AS CWSTR = AfxStrCSet("FreeBasic", 20, "*")
' ========================================================================================
PRIVATE FUNCTION AfxStrCSet (BYREF wszMainStr AS CONST WSTRING, BYVAL nStringLength AS LONG, BYREF wszPadCharacter AS WSTRING = " ") AS CWSTR
   IF LEN(wszMainStr) > nStringLength THEN RETURN LEFT(wszMainStr, nStringLength)
   DIM cws AS CWSTR = WSTRING(nStringLength, wszPadCharacter)
   MID(**cws, (nStringLength - LEN(wszMainStr)) \ 2 + 1, LEN(wszMainStr)) = wszMainStr
   RETURN cws
END FUNCTION
' ========================================================================================

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3087
    • Jos
Re: WinFBX Version 1.0
« Reply #51 on: May 26, 2018, 10:35:07 AM »

Modified the internal code of some string functions that worked with INSTR and CWSTR variables without using **.

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3087
    • Jos
Re: WinFBX Version 1.0
« Reply #52 on: May 28, 2018, 09:03:57 AM »

Modified the AfxOpenFileDialog and AfxSaveFileDialog that GPFed with FB 64 bit.

As always, you can get the most recent code in GitHub: https://github.com/JoseRoca/WinFBX
« Last Edit: May 28, 2018, 10:53:43 AM by Josť Roca »
Logged

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3087
    • Jos
Re: WinFBX Version 1.0
« Reply #53 on: June 21, 2018, 11:41:37 PM »

AfxWin.inc: Added the function AfxCommand. Like FB's COMMAND but Unicode aware.

Code: [Select]
' ========================================================================================
' Returns command line parameters used to call the program
' Unicode replacement for FreeBasic Command keyword.
' Usage: result = AfxCommand ( [ index ] )
' Parameter:
' - index : Zero-based index for a particular command-line argument.
' Return Value
'   Returns the command-line arguments(s).
' Description
'   - AfxCommand returns command-line arguments passed to the program upon execution.
'   - If index is less than zero (< 0), a space-separated list of all command-line arguments
'   is returned, otherwise, a single argument is returned. A value of zero (0) returns the
'   name of the executable; and values of one (1) and greater return each command-line argument.
'   - If index is greater than the number of arguments passed to the program, a null
'     string ("") is returned.
' ========================================================================================
PRIVATE FUNCTION AfxCommand (BYVAL nIndex AS LONG = -1) AS CWSTR
   DIM pArgsList AS WSTRING PTR PTR, nArgs AS LONG, cwsArgs AS CWSTR
   pArgsList = CAST(WSTRING PTR PTR, CommandLineToArgvW(GetCommandLineW, @nArgs))
   IF pArgsList = NULL OR nIndex > nArgs THEN RETURN cwsArgs
   IF nIndex < 0 THEN
      FOR i AS LONG = 1 TO nArgs - 1
         cwsArgs += *pArgsList[i] & " "
      NEXT
      cwsArgs = RTRIM(**cwsArgs)
   ELSE
      cwsArgs = *pArgsList[nIndex]
   END IF
   LocalFree CAST(HLOCAL, pArgsList)
   RETURN cwsArgs
END FUNCTION
' ========================================================================================

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3087
    • Jos
Re: WinFBX Version 1.0
« Reply #54 on: July 02, 2018, 03:42:37 PM »

Added some convenience wrappers to CTextStream.inc: OpenForInputA / W, OpenForOutputA / W and OpenForAppendA / W. This class allows to work easily with sequential files in ansi or unicode, with some advanced methods.

For binary files, the Windows API provides API functions that work perfectly with CWSTR strings, e.g.:

Code: [Select]
DIM cwsFilename AS CWSTR = "тест.txt"
DIM cwsText AS CWSTR = "Дмитрий Дмитриевич Шостакович"
DIM hFile AS HANDLE = CreateFileW(cwsFilename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)
WriteFile(hFile, cwsText, LEN(cwsText) * 2, NULL, NULL)
CloseHandle(hFile)

However, in the FB forum prefer to walk in circles:
https://www.freebasic.net/forum/viewtopic.php?f=2&t=26839

Johan Klassen

  • FireFly3 Registered User
  • Junior Member
  • *
  • Posts: 70
  • FF3 User
Re: WinFBX Version 1.0
« Reply #55 on: July 02, 2018, 04:12:32 PM »

thank you Josť Roca :)
just out curiosity I looked up "Дмитрий Дмитриевич Шостакович" and I got info on Dmitri Dmitriyevich Shostakovich
Logged

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3087
    • Jos
Re: WinFBX Version 1.0
« Reply #56 on: July 08, 2018, 07:16:01 PM »

6 Jul 2018 - Version 1.0.03

- CWSTR: Changed CONSTRUCTOR (BYVAL nChars AS UINT, BYVAL nCodePage AS UINT)
to CONSTRUCTOR (BYVAL nChars AS UINT, BYVAL bClear AS BOOLEAN)
The nCodePage parameter was no longer useful and the new bClear parameter allows to specify
if the memory will be intialized (cleared) or not.

- CWSTR: The default constructor now initializes the memory.

4 Jul 2018 - Version 1.0.03

- CWSTR: Changed the [] operator from one-based index to zero-based index.

ChrisC

  • FireFly3 User
  • Little Newbie FireFly
  • *
  • Posts: 27
Re: WinFBX Version 1.0
« Reply #57 on: July 25, 2018, 08:20:35 PM »

Hello all

what is the purpose of WinFBX ?   is it something like Jose's includes files for PB?
Logged

ChrisC

  • FireFly3 User
  • Little Newbie FireFly
  • *
  • Posts: 27
Re: WinFBX Version 1.0
« Reply #58 on: July 26, 2018, 11:36:40 AM »

WinFBX -- where can i get sample codes and applications on how to use it?

Any suggestions?  thanks all help appreciated
Logged

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3087
    • Jos
Re: WinFBX Version 1.0
« Reply #59 on: July 26, 2018, 11:39:41 AM »

The WinFBE editor comes with the include fiiles, examples and templates.

On-line help: http://www.jose.it-berater.org/WinFBX/WinFBX.html
Pages: 1 2 3 [4] 5