Search found 511 matches

by Josep Roca
May 10, 2021 17:05
Forum: General
Topic: redim inside function causing memory issue?
Replies: 10
Views: 479

Re: redim inside function causing memory issue?

Static arrays can also cause problems when used, e.g., inside a class. I did write an application called FBPiano that used a class (CPiano) with two static arrays in it, and I had to change them to global arrays. I kept the original and, in the changed version, I put the following remark: ' // Note:...
by Josep Roca
May 07, 2021 21:18
Forum: General
Topic: openfilename
Replies: 25
Views: 949

Re: openfilename

Although GetOpenFilename also works in 64 bit, it is a pain to use with unicode because of the embeded nulls. I have a wrapper, but needs to use my framework: https://github.com/JoseRoca/WinFBX/blob/master/docs/File%20Management/File%20Procedures.md#AfxOpenFileDialog It is easier to use the IFileOpe...
by Josep Roca
May 07, 2021 18:56
Forum: Projects
Topic: DWSTRING.bi - Dynamic null terminated unicode string data type
Replies: 27
Views: 4843

Re: DWSTRING.bi - Dynamic null terminated unicode string data type

> And I think it's not good to bloat our code with not-needed libs. I've heard that Some languages will only choose the required code from a big include file. I don't know how fbc works in this case. This is why WinFBX does not use libraries, but source code, and every method in the classes and ever...
by Josep Roca
May 07, 2021 18:01
Forum: Projects
Topic: DWSTRING.bi - Dynamic null terminated unicode string data type
Replies: 27
Views: 4843

Re: DWSTRING.bi - Dynamic null terminated unicode string data type

> Is there any difference in CWstr & DWSTRING ? The only differences are internal, but usage is the same. As I posted in one of the earlier posts: If you're using WinFBX, you can use CWSTR instead of DWSTRING and the AfxStr functions instead of the DWStr ones. I have posted these variations to m...
by Josep Roca
May 07, 2021 13:54
Forum: Projects
Topic: DWSTRING.bi - Dynamic null terminated unicode string data type
Replies: 27
Views: 4843

Re: DWSTRING.bi - Dynamic null terminated unicode string data type

1. Because @ is needed to get the address of the class. Otherwise, we could not pass a pointer to the class to another procedure. 2. Because in older versions of the compiler before 1.07 it was necessary to use * and ** to workaround a quirk of the compiler when working with statements like LTRIM, R...
by Josep Roca
Apr 22, 2021 2:49
Forum: Beginners
Topic: DECLARE FUNCTION curiosity
Replies: 3
Views: 226

Re: DECLARE FUNCTION curiosity

Use GenSortKey _ instead of GenSortKey_. Otherwise, the _ will be part of the function name, not a line continuation.
by Josep Roca
Apr 21, 2021 3:03
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)
Replies: 763
Views: 171498

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

The highlighting is done by the external Scintilla control, not by code in the editor. Therefore, it's not possible, unless you add the names of the functions to the list of FreeBasic keywords (in lower case).
by Josep Roca
Apr 20, 2021 23:14
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)
Replies: 763
Views: 171498

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.2.0 March 26, 2021)

Sure. Menu --> Options --> Environment Options --> Coolors and Fonts --> Kewords.
by Josep Roca
Mar 18, 2021 18:37
Forum: Beginners
Topic: How to change the back color of a control at runtime ?
Replies: 43
Views: 3708

Re: How to change the back color of a control at runtime ?

Thanks for the compliments. > P.S.: If I add a BS_COMMANDLINK style to the pXpButton3 button in Josep Roca's example, it doesn't change at all. This control was not intended as a replacement of the Windows button control. I first wrote it with PowerBasic many years ago, in XP times (hence the "...
by Josep Roca
Mar 17, 2021 14:27
Forum: Beginners
Topic: How to change the back color of a control at runtime ?
Replies: 43
Views: 3708

Re: How to change the back color of a control at runtime ?

I have used CDRF_* values previously, mainly with ListViews, but wasn't aware that buttons did support CDRF_NOTIFYPOSTPAINT. Apparently it was introduced in Windows Vista and you must use a manifest. > Your Button class is amazing. I am using sub classing but you create a new window class for creati...
by Josep Roca
Mar 15, 2021 18:00
Forum: Beginners
Topic: How to change the back color of a control at runtime ?
Replies: 43
Views: 3708

Re: How to change the back color of a control at runtime ?

Te button must be owner draw. Then you can process the WM_CTLCOLORBTN message. The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent ...
by Josep Roca
Mar 15, 2021 3:31
Forum: General
Topic: Default BYVAL or BYREF Parameter Passing?
Replies: 138
Views: 33828

Re: Default BYVAL or BYREF Parameter Passing?

Add BYVAL or BYREF explicitily to the parameters, instead of relying on defaults, and you won't have any problem.
by Josep Roca
Feb 27, 2021 21:29
Forum: Beginners
Topic: Convert vbscript to FB
Replies: 10
Views: 959

Re: Convert vbscript to FB

Using the WinFBX framework: #INCLUDE ONCE "Afx/CWindow.inc" Var num1 = CInt(AfxInputBox( , , , "Input Box", "Enter the no. of rotten apples: ")) Var num2 = CInt(AfxInputBox( , , , "Input Box", "Enter the total no. of apples: ")) AfxMsg "The perc...
by Josep Roca
Feb 27, 2021 15:14
Forum: Windows
Topic: Simple tutorial to create first Windows applications
Replies: 37
Views: 2709

Re: Simple tutorial to create first Windows applications

> What exactly does exit function then? Is it the right way to return (?) a value from a WM_* handler in FB? Return is a shortcut for FUNCTION = value : EXIT FUNCTION. If you simply use EXIT FUNCTION, it is the same that if you did FUNCTION = 0 : EXIT FUNCTION, that is, FB returns a value of 0, and ...

Go to advanced search