Search found 498 matches

by Josep Roca
Feb 27, 2021 21:29
Forum: Beginners
Topic: Convert vbscript to FB
Replies: 10
Views: 650

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: 1679

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 ...
by Josep Roca
Feb 27, 2021 3:47
Forum: Windows
Topic: Simple tutorial to create first Windows applications
Replies: 37
Views: 1679

Re: Simple tutorial to create first Windows applications

> 1. You declare WndProc as a function. That's possible but very unusual, as nobody will ever used the returned value I beg to differ. What is unusual is to use a sub (it's the first time that I have seen that). The returned value is used by Windows. For example: if you want to abort the creation of...
by Josep Roca
Feb 23, 2021 14:43
Forum: Community Discussion
Topic: WinFBE "Visual Designer" use with the WinFBX library
Replies: 1
Views: 395

Re: WinFBE "Visual Designer" use with the WinFBX library

You can use the WinFBE editor to code CWindow forms by hand, but not the visual designer, that is tailored to use WinFormsX.

Sorry for the delay, but I wasn't aware of this post.
by Josep Roca
Feb 18, 2021 21:26
Forum: Tips and Tricks
Topic: Easy Windows API Tutorial
Replies: 44
Views: 22497

Re: Easy Windows API Tutorial

> Windows messages (WM_...) allow to modify something by returning non-default values, and afaics this is not possible with the dialog engine - but I am ready to learn new things, Josep ;-) You can return values just using Return <something>. There are differences like receiving the WM_INITDIALOG me...
by Josep Roca
Feb 17, 2021 21:13
Forum: Tips and Tricks
Topic: Easy Windows API Tutorial
Replies: 44
Views: 22497

Re: Easy Windows API Tutorial

The Windows Dialog Engine does not use DefWindowProc. It does its own processing.
by Josep Roca
Feb 17, 2021 19:12
Forum: Tips and Tricks
Topic: Easy Windows API Tutorial
Replies: 44
Views: 22497

Re: Easy Windows API Tutorial

Using "#32770" as the class name what it does is to create a dialog using the WIndows Dialog Engine. Nothing new. This technique was thought to be used mainly for auxiliary dialogs and is more limited that creating a window using your own class name. You can also use DialogBox, CreateDialo...
by Josep Roca
Jan 07, 2021 15:59
Forum: Tips and Tricks
Topic: Example using WinHTTP API to read out web page's code [Windows only]
Replies: 15
Views: 766

Re: Example using WinHTTP API to read out web page's code [Windows only]

You can change the value in WaitForResponse if needed. -1 is infinite time-out.
by Josep Roca
Jan 07, 2021 15:26
Forum: Tips and Tricks
Topic: Example using WinHTTP API to read out web page's code [Windows only]
Replies: 15
Views: 766

Re: Example using WinHTTP API to read out web page's code [Windows only]

It works correctly using the WinFBE editor and the files that come with it. I don't know how you have compilet it.
by Josep Roca
Jan 07, 2021 15:06
Forum: Tips and Tricks
Topic: Example using WinHTTP API to read out web page's code [Windows only]
Replies: 15
Views: 766

Re: Example using WinHTTP API to read out web page's code [Windows only]

If I may, an example using my WinFBX framework: '#CONSOLE ON #include once "Afx/CWinHttpRequest.inc" using Afx ' // Create an instance of the CWinHttp class DIM pWHttp AS CWinHttpRequest ' // Open an HTTP connection to an HTTP resource pWHttp.Open "GET", "http://forum.qbasic...
by Josep Roca
Dec 12, 2020 21:49
Forum: General
Topic: @Josep Roca, about Afx/CVar.inc
Replies: 16
Views: 927

Re: @Josep Roca, about Afx/CVar.inc

These API functions that deal with variants do a lot of work. For example, this is the C++ code for VarSub as implemented in ReactOS: HRESULT WINAPI VarSub ( LPVARIANT left, LPVARIANT right, LPVARIANT result ) { HRESULT hres = S_OK; VARTYPE resvt = VT_EMPTY; VARTYPE leftvt,rightvt; VARTYPE rightExtr...
by Josep Roca
Dec 12, 2020 21:33
Forum: General
Topic: @Josep Roca, about Afx/CVar.inc
Replies: 16
Views: 927

Re: @Josep Roca, about Afx/CVar.inc

It is ignored since "1" is not a number, but a string. Ok but how to explain that in the variation by srvaldez : v1 = v1 - "1" gives the right value ? Because in the operator - , I call the API function VarSub without checking the type of the passed variants ' ==================...
by Josep Roca
Dec 12, 2020 21:04
Forum: General
Topic: @Josep Roca, about Afx/CVar.inc
Replies: 16
Views: 927

Re: @Josep Roca, about Afx/CVar.inc

> Shouldn't it throw an error instead of ignoring the "1"? How? It is an operator, not a function that can return a value. Anyway, I have found the problem: the constructor CONSTRUCTOR CVar (BYVAL _value AS DOUBLE) conflicts with the constructor CONSTRUCTOR CVar (BYVAL _value AS DOUBLE, BY...
by Josep Roca
Dec 12, 2020 14:44
Forum: General
Topic: @Josep Roca, about Afx/CVar.inc
Replies: 16
Views: 927

Re: @Josep Roca, about Afx/CVar.inc

> Unless I don't understand but v1 -="1" also doesn't work as the value of v1 is still 2. Shouldn't it be 1 ?

It is ignored since "1" is not a number, but a string.
by Josep Roca
Dec 11, 2020 1:32
Forum: General
Topic: @Josep Roca, about Afx/CVar.inc
Replies: 16
Views: 927

Re: @Josep Roca, about Afx/CVar.inc

For some reason unknown to me, when passing a float value to a CVAR constructor, the compiler complains about an ambiguous call error, and when using v1 += 1.2345 it doesn't call the += operator, but does a cast to a WSTRING!

This works: v1 += CVAR(1.2345, "DOUBLE")

Go to advanced search