Search found 475 matches

by Josep Roca
Aug 12, 2020 19:08
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 654

Re: Byref in return function

To clone an IPicture object you have to: 1.- As IPicture supports the IPersistStream interface, get a pointer to it with QueryInterface. 1.- Create an Stream in memory. 3.- Save the contents in the Stream using the Save method of the IPersistStream interface. 4. Create a new IPicture object with the...
by Josep Roca
Jul 01, 2020 11:12
Forum: Windows
Topic: SOLVED - MPEG2 Play Code and Win10
Replies: 67
Views: 2932

Re: SOLVED - MPEG2 Play Code and Win10

> I put his .bas file into the WinFBE_Suite\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\inc folder

If you have WinFBE installed, the full example, complete with a manifest and other resources is provided in the WinFBE\Sample_Projects\DShow_PlayClip subfolder.
by Josep Roca
Jun 26, 2020 16:17
Forum: Windows
Topic: SOLVED - MPEG2 Play Code and Win10
Replies: 67
Views: 2932

Re: MPEG2 Play Code and Win10

> have you just got the bare bones of this code that just plays a vid? The main code is in the sub PlayMovieInWindow and in the processing of the WM_GRAPHNOTIFY message. In Windows we need a GUI to be able to process the WM_GRAPHNOTIFY (*) message in the callback procedure of the window. CWindow.inc...
by Josep Roca
Jun 26, 2020 3:55
Forum: Windows
Topic: SOLVED - MPEG2 Play Code and Win10
Replies: 67
Views: 2932

Re: MPEG2 Play Code and Win10

I have one that works, but haven't posted it here because I use my own framework.
See: https://github.com/JoseRoca/WinFBX/blob ... ayClip.bas
by Josep Roca
Jun 20, 2020 9:58
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.7 May 31, 2020)
Replies: 718
Views: 132245

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (V2.1.7 May 31, 2020)

> No variable on next statement

FreeBasic does not use a variable in the next statement. That is an obsolete syntax. It won't complain if you put one, but it is ignored.
by Josep Roca
Jun 12, 2020 15:45
Forum: Windows
Topic: how to use FreeBASIC\Examples\windows\variants ?
Replies: 10
Views: 7224

Re: how to use FreeBASIC\Examples\windows\variants ?

If you're using WinFBE, you already have my WinFBX framework with it, so maybe you will find useful to look at the CVAR class. See: https://github.com/JoseRoca/WinFBX/blob/master/docs/COM/CVAR%20Class.md It is easy to use, e.g. '#CONSOLE ON #INCLUDE ONCE "Afx/CVar.inc" USING Afx DIM s AS S...
by Josep Roca
May 31, 2020 22:13
Forum: Windows
Topic: How to deal with COM objects?
Replies: 6
Views: 378

Re: How to deal with COM objects?

My next step will be to find the CLSID of WASAPI and try to figure out how to run its functions, now that the COM link is done! I'll try and post feedback then. Thanks again :) WASAPI has not a CLSID. WASAPI consists of several interfaces. The first of these is the IAudioClient interface. To access...
by Josep Roca
May 31, 2020 20:36
Forum: Windows
Topic: How to deal with COM objects?
Replies: 6
Views: 378

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

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

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

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

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

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

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

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.

Go to advanced search