• Welcome to PlanetSquires Forums.
 
Main Menu

Recent posts

#1
Hi All

I am using the Clayout code to resize my control on numerous pages in a TABCONTROL.
Something I am curious about it this portion in Frmain you place before the functions:
dim shared as clayout ptr Playout         'A shared pointer so it can be seen in all functions
dim shared as boolean form_ready=false

Should the FORM_READY that was declared not be accessible to all pages in the entire project?
If I resize the controls on the Mainform only then there is no problem.
On other forms it gets a bit weird.

The FORM_READY is returned as an undeclared variable.

However if i put that dim shared as boolean form_ready=falseon top op Form4 (a Child form) instead of FrmMain and add FORM_READY=FALSE to the FrmMain_LOAD event, then it works perfectly across all the forms.

But knowing the perfection of José's code, this can only mean I am lining myself up for a spectacular crash at some point.

What am I missing?

-regards Peter
#2
Hi All

I have a tabcontrol on my main from with 4 pages.
One of those is a settings page with a few listviews getting data from a database.

All the other pages will have comboboxes which will get some of their info from a column in that listview.

Since they are all loading on a TABCONTROL, which one loads first?
In old project with flat files I just ran a fileopen for each page, read what I wanted and populated the Combobox. That now seem like unnecessary actions when I can just let a simple function get the same data from another page in a listview.

The question then is, How do I ensure that the tab with the settings load before the others to avoid null returns to the other pages?

-Regards, Peter
 
#3
 ;D  ;D
#4
WinFBX - Windows Framework for FreeBASIC / Re: Cprint Question
Last post by Bumblebee - August 13, 2022, 05:53:04 AM
DIM cws AS CWSTR = AfxStrRetain("abacadabra","b")   ' -> "bb"
DIM cws AS CWSTR = AfxStrRetain("Brigitte Bardot","B")   ' -> "BB"

Sorry, couldn't help myself  ;D
#5
WinFBX - Windows Framework for FreeBASIC / Re: Cprint Question
Last post by Petrus Vorster - August 12, 2022, 06:24:44 PM
https://github.com/JoseRoca/WinFBX/blob/master/docs/String%20Management/String%20Procedures.md

That is a lot of work right there.
Without you two I still would be at Print "Hello World".

-Regards, Peter
#6
WinFBX - Windows Framework for FreeBASIC / Re: Cprint Question
Last post by Petrus Vorster - August 12, 2022, 06:16:20 PM
I just missed this : pPrint.GetDefaultPrinter
I am very happy that I got that far already!!!

Thanks a million.

-Peter
#7
WinFBX - Windows Framework for FreeBASIC / Re: Cprint Question
Last post by Paul Squires - August 12, 2022, 06:02:32 PM
To get a list of printer names you would use the EnumPrinterNames method and parse out the CHR(13,10) that separates each entry in the returned CWSTR string. Jose probably already has an example of this somewhere on this site. Not sure.

You would use the AfxParse() function from Jose's library. There are many VERY useful string manipulation functions in his AfxStr.inc file. Here is a list of the functions. Get to know them.  :)
https://github.com/JoseRoca/WinFBX/blob/master/docs/String%20Management/String%20Procedures.md
#8
WinFBX - Windows Framework for FreeBASIC / Re: Cprint Question
Last post by Paul Squires - August 12, 2022, 05:57:19 PM
I am on my Linux machine right now so I can't produce a working example, but the code would look something like this:

' Create an instance of the CPrint class
DIM pPrint AS CPrint

' Call the class method to get the default printer and store it in a dynamic unicode string (CWSTR)
DIM wszDefault AS CWSTR = pPrint.GetDefaultPrinter

' Display the printer name that was returned
PRINT wszDefault

Here is Jose's online documentation for the class that should be the very latest. I also have this documentation built into WinFBE's help system.

https://github.com/JoseRoca/WinFBX/blob/master/docs/Printing/CPrint%20Class.md




#9
WinFBX - Windows Framework for FreeBASIC / Cprint Question
Last post by Petrus Vorster - August 12, 2022, 05:25:03 PM
Hi All

How am I supposed to create the CWSTR to use the Getdefaultprinter function?

It is clear I am missing something in the DIM statement.
I am getting all kinds of errors.
I am not yet clued up on this CWSTR use.

And how would I create a list of printers parsed into a combobox?

Your help will be really appreciated.

-Peter
#10
Hi All

Perhaps some of you may run into this. I have found the solution.

I have made a small tool in Windows10 that uses sqlite and uses a listview to display the data.
If run in Windows7, the listview texts is severely distorted, text missing , strange characters etc.

After some search I have discovered you need to change the properties for the EXE in windows7 to Compatibility with WIN7 and DISABLE the display scale settings on High DPI settings.
From that point onwards it appears to be working just fine.

-Peter