Winmm.dll (2 years old) and Winmmbase.dll (6 years old) are in my system32 windows folder. No other similar files or version available. Placing these two files in the QB64PE folder made no difference in this case.
My system is 9 years old, and maybe these drivers are not up to date enough. Thanks for letting me know you had a similar situation. I thought I had missed some posted forum attachment.
Problem, you talk about create program from reply #10. Use program from reply #14, this run correctly here (MJPG + ADPCM, or MJPG + PCM). Windows 10 64bit, all updates.
Winmm.dll (2 years old) and Winmmbase.dll (6 years old) are in my system32 windows folder. No other similar files or version available. Placing these two files in the QB64PE folder made no difference in this case.
My system is 9 years old, and maybe these drivers are not up to date enough. Thanks for letting me know you had a similar situation. I thought I had missed some posted forum attachment.
I get short sound loop only, and an error message that the app can't find the decompressor. So Petr wrote back to use post #14. I just tried it, but it causes the app to crash after about 10 seconds of that spinning windows progress circle.
(12-15-2025, 06:30 PM)Petr Wrote: @Mad Axeman, I didn't forget. Here's a version of ListMenu for Windows without the top search bar. This time it's in the form of a .h file. This eliminates the need to create 32-bit and 64-bit DLLs.
Thanks. At the moment work is getting in the way of things but that should stop next week. I'll take a look at it then.
12-19-2025, 02:39 PM (This post was last modified: 12-19-2025, 02:56 PM by Unseen Machine.)
Pete, YOURE OLD MAN! Accept it! (Also if you talk to Ted, say hi from me!)
Now, i can do it one of two ways but MY way is the best and easiest....so the first way (QB64 only code) aint gonna happen!
From me telling Googles Ai the premise and then ages making tweaks and telling it to not be so smart as Im dumb here's and idea...
FOR YOU ill make anything if i can or go for Aspirins after 2 days of failiure!
TELL ME how youd want it, the requirements, what does QB64 need to see? (load, play, pause, volume etc...) and then bish bash bosh and you'll owe me a +1
Me, my idea is to allow for any number of AVIs to be loaded, each ones state stored internally and then each AVI referenced via index. QB64 will only ever need the index, when loading a new avi the index returned is that file and then all concurrent commands take said index and do their thing!
John
*NOTE the below is me chatting with google
To implement the QB_AVI system, we will use a C++ structure (UDT) to track each video’s state and store them in a std::vector. The C++ layer will return a simple index to QB64.
1. The C++ Core (QB_AVI.cpp)
This code manages the video metadata. We use mciSendCommand for speed and efficiency.
cpp
#include <windows.h>
#include <mmsystem.h>
#include <vector>
#include <string>
QB_EXPORT void QB_AVI_Render(int index, HWND hwnd, int x, int y, int w, int h) {
if (index < 0 || index >= AVIs.size()) return;
QB_AVI_STATE &v = AVIs[index];
// Play from current
MCI_PLAY_PARMS play = {0};
mciSendCommand(v.deviceID, MCI_PLAY, 0, (DWORD_PTR)&play);
}
QB_EXPORT long QB_AVI_GetPos(int index) {
if (index < 0 || index >= AVIs.size()) return 0;
MCI_STATUS_PARMS status = {0};
status.dwItem = MCI_STATUS_POSITION;
mciSendCommand(AVIs[index].deviceID, MCI_STATUS, MCI_STATUS_ITEM, (DWORD_PTR)&status);
return status.dwReturn;
}
Use code with caution.
2. QB64 Library Declaration
In QB64, you link the compiled DLL. Note the use of _OFFSET for the window handle (essential for 64-bit compatibility in 2025).
vb
DECLARE DYNAMIC LIBRARY "QB_AVI"
FUNCTION QB_AVI_Load% (filename AS STRING)
SUB QB_AVI_Render (BYVAL index AS LONG, BYVAL hwnd AS _OFFSET, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL w AS LONG, BYVAL h AS LONG)
FUNCTION QB_AVI_GetPos& (BYVAL index AS LONG)
END DECLARE
IF vIndex% >= 0 THEN
QB_AVI_Render vIndex%, _WINDOWHANDLE, 0, 0, 1280, 720
DO
LOCATE 1, 1: PRINT "Current Frame:"; QB_AVI_GetPos(vIndex%)
_LIMIT 60
LOOP UNTIL _KEYHIT = 27
END IF
Use code with caution.
Why this is a "Cake Walk"
Vector Management: QB64 only passes a LONG index. You can load 100 AVIs and the C++ side manages the memory via the vector.
UDT Logic: Properties like start, end, and vol are stored in the C++ struct. You can add getters/setters easily (e.g., QB_AVI_SetVol).
Handle Safety: By using _WINDOWHANDLE, the video is clipped and rendered directly by the Windows display driver into your QB64 workspace.
SIDE NOTE : From my current DEV ive learned that there is NEXT TO NOTHING we cant add to QB64 using C/C++ wrappers and declare lib...SO IF ANYONE WANTS ANYTHING else like this...ask and i will deliver or tell you im too dumb to do it!
Second note @ DEVS : ADD A _Screen function...I KNOW that GL 4.6, DX 9-11/12 and VULKAN are not HARD to implement. In fact id wager that at least for Gl no more than 5 or 6 lines of code need to be added to allow Qb64 to use all GL functionality! (Not bragging here but Galleon used SFML to demo Declare library and GL. He was VERY against adding GL to QB64 until i showed my work, begged and pleaded and eventually he made the work around we have today) That was 2011 and even then it was OLD! My new GDK allows for any number of screens in any render mode, GL DX etc...so if you dont add it I will!
12-19-2025, 03:08 PM (This post was last modified: 12-19-2025, 03:10 PM by Petr.)
@Pete
First question. Does the video that doesn't play play in VLC, or WMP, or a media player? What operating system are you using for that?
Attached is an MJPG video with ADPCM sound (output of a program written in QB64PE without C language) - the quality is terrible but it's for the purpose of testing the function for you. This video plays in this player for me. How does it work for you? Do you have the necessary codecs on your computer? There were 2 small bugs in that program that test the error return code, but that doesn't affect the playback itself. Try it and let me know.
Code: (Select All)
Option _Explicit
Declare Dynamic Library "winmm"
Function mciSendStringA& (lpstrCommand As String, lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As _Offset)
Function mciGetErrorStringA& (ByVal dwerrsor As Long, lpstrBuffer As String, ByVal uLength As Long)
End Declare
Dim filename As String, aliasName As String
filename = "aaa_dop.avi"
aliasName = "vid"
Dim cm As String, e As Long
Dim dummy As String: dummy = Space$(1)
' 1) Open
cm = "open " + Chr$(34) + filename + Chr$(34) + " type mpegvideo alias " + aliasName
e = mciSendStringA&(cm, dummy, 0, 0): MCI_Check e, cm
' 2) Attach to QB64 window handle (more stable than parent/style child)
cm = "window " + aliasName + " handle " + LTrim$(Str$(hwnd))
e = mciSendStringA&(cm, dummy, 0, 0): MCI_Check e, cm
' 3) Set destination rect (not "put window at")
cm = "put " + aliasName + " destination at 0 0 800 600"
e = mciSendStringA&(cm, dummy, 0, 0): MCI_Check e, cm
' 4) Play
cm = "play " + aliasName
e = mciSendStringA&(cm, dummy, 0, 0): MCI_Check e, cm
Do
_Limit 60
_Display ' let s messages going and window as active (QB64 help)
Loop Until InKey$ <> ""
Dim N As Long
N = mciSendStringA&("stop " + aliasName, dummy, 0, 0)
N = mciSendStringA&("close " + aliasName, dummy, 0, 0)
End
Sub MCI_Check (errsCode As Long, where As String)
Dim n As Long
If errsCode <> 0 Then
Dim msg As String
msg = Space$(256)
n = mciGetErrorStringA&(errsCode, msg, Len(msg))
Print "MCI error ("; errsCode; "): "; where
Print RTrim$(msg)
Sleep
End
End If
End Sub
12-19-2025, 10:35 PM (This post was last modified: 12-19-2025, 10:36 PM by Petr.)
This is a video player written in C++. Attached are the 32-bit and 64-bit DLLs, the source code, BAS program and all the files needed for compilation. The only bug in the program is that it cannot be run in fullscreen mode, because the video window then hides behind the QB64PE screen. I will be porting this program to Linux in the near future as well - I finally finished installing Linux yesterday to laptop with everything that’s needed.
The program includes options to fast-forward and rewind, play at reduced, normal, or increased speeds, control the volume, and pause/resume the video. Of course, you can position it anywhere on the screen (with adjustable width and height for the video playback). There is also an option to zoom the video in or out using the + and - buttons.