This code from https://forum.powerbasic.com/forum/u...-capture-redux, post #4, works on my old PC but not on the PC I just purchased. The original Jose code, on which this code is based, also does not work on the new PC. Both result in an error #99 (Object Error).
I made sure that the include files were identical.
The new PC has Windows 10 Pro, whereas the old PC has Windows 10 Home.
Source code plus includes - what else is there on a new PC that might be involved in the failure?
I made sure that the include files were identical.
The new PC has Windows 10 Pro, whereas the old PC has Windows 10 Home.
Source code plus includes - what else is there on a new PC that might be involved in the failure?
Code:
'Compilable Example: Play Video - Minimal Code #Compiler PBWin 10 #Compile Exe #Dim All %Unicode = 1 #Include "Win32API.inc" #Include Once "dshow.inc" #Include Once "ole2utils.inc" ' For IUnknown_Release %IDC_Graphic = 500 %WM_GraphNotify = %WM_User+13 Global hDlg As Dword ' Interface pointers Global pIGraphBuilder As IGraphBuilder Global pIMediaControl As IMediaControl Global pIMediaEventEx As IMediaEventEx Global pIVideoWindow As IVideoWindow Function PBMain() As Long Dialog New Pixels, 0, "Direct Show Tests",,,600,400, %WS_OverlappedWindow To hDlg Dialog Show Modal hDlg Call DlgProc End Function CallBack Function DlgProc() As Long Local w,h As Long, rc As Rect Select Case Cb.Msg Case %WM_InitDialog PlayMovieInWindow(hDlg, "bubbles.mov") Case %WM_Size GetClientRect hDlg, rc If IsObject(pIVideoWindow) Then pIVideoWindow.SetWindowPosition(rc.Left, rc.Top, rc.Right, rc.Bottom) RedrawWindow hDlg, rc, 0, %RDW_INVALIDATE Or %RDW_UPDATENOW End If End Select End Function Sub PlayMovieInWindow (ByVal hwnd As Dword, ByRef wszFileName As WStringZ) Local hr As Long pIGraphBuilder = NewCom ClsId $CLSID_FilterGraph ' Create an instance of the IGraphBuilder object pIMediaControl = pIGraphBuilder ' Get reference pointers pIMediaEventEx = pIGraphBuilder pIVideoWindow = pIGraphBuilder hr = pIGraphBuilder.RenderFile(wszFileName) ' Render the file pIVideoWindow.Visible = %OATRUE ' Set the window properties pIVideoWindow.Owner = hwnd pIVideoWindow.WindowStyle = %WS_Child Or %WS_ClipSiblings Or %WS_ClipChildren pIMediaControl.Run ' Run the graph End Sub
Comment