Search found 483 matches

by Josep Roca
May 31, 2020 20:36
Forum: Windows
Topic: How to deal with COM objects?
Replies: 6
Views: 450

Re: How to deal with COM objects?

Please note that I'm using a low-level interface and a free registration technique. If you want to mess with registration, dual interfaces, type libraries, etc., it is up to you.
by Josep Roca
May 31, 2020 20:31
Forum: Windows
Topic: How to deal with COM objects?
Replies: 6
Views: 450

Re: How to deal with COM objects?

Test for the above example: '#CONSOLE ON #define UNICODE #INCLUDE ONCE "windows.bi" #include once "win/ocidl.bi" '#include once "Afx/AfxCOM.inc" DECLARE FUNCTION AfxSafeRelease (BYREF pv AS ANY PTR) AS ULONG DECLARE FUNCTION AfxNewCom OVERLOAD (BYREF wszLibName AS CONST...
by Josep Roca
May 31, 2020 20:31
Forum: Windows
Topic: How to deal with COM objects?
Replies: 6
Views: 450

Re: How to deal with COM objects?

Template for a COM server: ' // Free Basic source code to a simple COM object, compiled into an ordinary ' // dynamic link library (DLL). #include once "windows.bi" #include once "win/ocidl.bi" ' Things to change: ' - The name of the interface ' - CLSID and IID of the inteface ' ...
by Josep Roca
May 18, 2020 10:53
Forum: Windows
Topic: Help needed from José, again
Replies: 8
Views: 474

Re: Help needed from José, again

My wrappers for Windows common controls follow the naming style of the ones provided in windowsx.bi and commctrl.bi. I have provided additional ones in AfxCtl.inc. Documentation of the macros provided by the Windows headers: windowsx: https://docs.microsoft.com/en-us/windows/win32/api/windowsx/ comm...
by Josep Roca
May 18, 2020 9:55
Forum: Windows
Topic: Help needed from José, again
Replies: 8
Views: 474

Re: Help needed from José, again

@David You should be grateful for having the "Button_xxx" wrappers. Otherwise, you will have to use DeleteObject(cast(HGDIOBJ, SendMessage(GetDlgItem(hwnd, ID_Top), BM_SETIMAGE, cast(WPARAM, IMAGE_BITMAP), cast(LPARAM, hbmp)))) I was afraid to post it :) Frankly, CONTROL ADD IMGBUTTON is s...
by Josep Roca
May 18, 2020 8:16
Forum: Windows
Topic: Help needed from José, again
Replies: 8
Views: 474

Re: Help needed from José, again

SDK guys have better techniques that killing everybody :) This should work: DIM hBmp AS HBITMAP IF Topmost THEN hBmp = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(102)) ELSE hBmp = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(101)) END IF IF hBmp THEN DIM hButton AS HWND = GetDlgItem(hwnd...
by Josep Roca
May 09, 2020 17:54
Forum: Beginners
Topic: Print bug?
Replies: 4
Views: 319

Re: Print bug?

He wanted to print it as an UInteger.

Otherwise, you can do

Print -&hFFFFFFFF ' Prints 1
by Josep Roca
May 09, 2020 17:31
Forum: Beginners
Topic: Print bug?
Replies: 4
Views: 319

Re: Print bug?

And how is going the compiler to know that you want it to be cast as UInteger if you don't tell it?

Use Print &hFFFFFFFFull

ull is the UInteger suffix.
by Josep Roca
May 01, 2020 2:40
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.7 May 31, 2020)
Replies: 719
Views: 136141

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.4 April 26, 2020)

I found the source of the warning in WinFBX includes. The AfxWin.inc and CSafeArray.inc code both contain a call to strstr with an "ANY PTR" and a ZSTRING argument instead of the expected const char *. The FB headers use ztring: #undef strstr declare function strstr (byval as const zstrin...
by Josep Roca
Apr 26, 2020 0:04
Forum: Windows
Topic: Begging bowl time for José Roca <smile>
Replies: 10
Views: 591

Re: Begging bowl time for José Roca <smile>

For clarification: DestroyWidow is what ends the application by destroying the main window and its child controls (and other things) and PostQuitMessage(0) is sent to exit the message pump (otherwise, the application will remain in memory performing an infinite loop). With dialogs you use EndDialog ...
by Josep Roca
Apr 25, 2020 22:28
Forum: Windows
Topic: Begging bowl time for José Roca <smile>
Replies: 10
Views: 591

Re: Begging bowl time for José Roca <smile>

To end the program, instead of using PostQuitMessage(0) in WM_TIMER, use DestroyWindow(hDlg) DestroyWindow is a bit rude. Normally, I use Sendmessage(hWnd, WM_CLOSE, 0, 0). Thus, the program can show a MessageBox in case there is something to save before closing. Me too, but according David's post ...
by Josep Roca
Apr 25, 2020 19:23
Forum: Windows
Topic: Begging bowl time for José Roca <smile>
Replies: 10
Views: 591

Re: Begging bowl time for José Roca <smile>

Apparently you think that creating a mutex with the name of the editor will allow you to know if it is running or not, but this will fail if the editor has not created an identical mutex and it is keeping it active. As the editor uses "WinFBE_Class" as its class name, the easiest way is to...
by Josep Roca
Apr 18, 2020 0:36
Forum: Community Discussion
Topic: Could someone make a list of FreeBASIC GUI libraries/frameworks?
Replies: 166
Views: 6709

Re: Could someone make a list of FreeBASIC GUI libraries/frameworks?

@jj2007,

If you bother to look at the code of the Windows version, you will see that it only supports ansi.
by Josep Roca
Apr 15, 2020 12:52
Forum: Beginners
Topic: Help with GetTokenInformation (Windows)
Replies: 4
Views: 264

Re: Help with GetTokenInformation (Windows)

With Basic, there is not need to try to mimic C++ 100% #include once "windows.bi" Dim As HANDLE hProc Dim As WinBOOL res Dim As TOKEN_ELEVATION_TYPE nTokenElevationType Dim As HANDLE hProcessToken Dim As DWORD dwProcessTokenInfoAllocSize ' Get the current Process Handle hProc = OpenProcess...
by Josep Roca
Apr 10, 2020 18:42
Forum: Beginners
Topic: Compile error [Solved]
Replies: 4
Views: 357

Re: Compile error

If you're compiling using the 64-bit compiler, use GetWIndowLongPtr and SetWindowLongPtr.

Go to advanced search