Can anyone get this going in Blitz/plus/3D?

Blitz3D Forums/Blitz3D Userlibs/Can anyone get this going in Blitz/plus/3D?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

tried it in b3d, it didn't want to work though. not sure if this is because of what i was doing as i was sure i had the decls right. then i gave up. you might want to use a dll from PB to do this. anyway, here is what i had.

Avicap32.decls (you need User32.decls too)
.lib "Avicap32.dll"

capCreateCaptureWindow%(lpszWindowName$,dwStyle,x,y,nWidth,nHeight,hWnd,nID):"capCreateCaptureWindowA"
capGetDriverDescription%(wDriverIndex,lpszName$,cbName,lpszVer$,cbVer):"capGetDriverDescriptionA"
Avicap32.bb
;Avicap32.dll test

;winuser.h constants
Const WM_USER = 1024
Const WS_CHILD = $40000000
Const WS_VISIBLE = $10000000

Const WM_CAP_START = WM_USER
Const WM_CAP_SET_CALLBACK_FRAME = WM_CAP_START + 5
Const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10
Const WM_CAP_SET_OVERLAY = WM_CAP_START + 51
Const WM_CAP_SET_PREVIEW = WM_CAP_START + 50
Const WM_CAP_SET_PREVIEWRATE = WM_CAP_START + 52
Const WM_CAP_SET_SCALE = WM_CAP_START + 53

Graphics3D 320,240,0,2
AppTitle "cam"
SetBuffer BackBuffer()

style=WS_CHILD+WS_VISIBLE
hWnd=Api_GetForegroundWindow()
hWndC=capCreateCaptureWindow("cap",style,0,0,320,240,hWnd,1) ;<- this crashes

Api_SendMessage(hWndC,WM_CAP_DRIVER_CONNECT,0,0)
Api_SendMessage(hWndC,WM_CAP_SET_SCALE,True,0)
Api_SendMessage(hWndC,WM_CAP_SET_PREVIEW,True,0)
Api_SendMessage(hWndC,WM_CAP_SET_PREVIEWRATE,24,0)

While Not KeyHit(1)

 Cls
 Text 0,0,""

Flip
Wend