在pb中调用摄像关怎么没反应呀?急
这是我的代码,看不出来错误,但执行时摄像头没反应,跟踪看了窗口句柄ul_llt和返回值变量都非空,请高手看看指点,急!
//global var:
uint lhand
constant long WM_USER=1024
constant long WM_CAP_START = WM_USER
constant long WM_CAP_STOP = WM_CAP_START + 68
constant long WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10
constant long WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11
constant long WM_CAP_SAVEDIB = WM_CAP_START + 25
constant long WM_CAP_GRAB_FRAME = WM_CAP_START + 60
constant long WM_CAP_SEQUENCE = WM_CAP_START + 62
constant long WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20
constant long WM_CAP_SEQUENCE_NOFILE =WM_CAP_START+ 63
constant long WM_CAP_SET_OVERLAY =WM_CAP_START+ 51
constant long WM_CAP_SET_PREVIEW =WM_CAP_START+ 50
constant long WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START +6
constant long WM_CAP_SET_CALLBACK_ERROR=WM_CAP_START +2
constant long WM_CAP_SET_CALLBACK_STATUSA= WM_CAP_START +3
constant long WM_CAP_SET_CALLBACK_FRAME= WM_CAP_START +5
constant long WM_CAP_SET_SCALE=WM_CAP_START+ 53
constant long WM_CAP_SET_PREVIEWRATE=WM_CAP_START+ 52
//global external function
public function ulong capCreateCaptureWindowA(string lpszWindowName,ulong dwStyle,long x,long y,long nWidth,long nHeight,ulong ParentWin,long nId) library "AVICAP32.DLL";
//w_video中的cb_start
string lpszName
ulong ul_ll
ul_ll=handle(w_video)
lpszName='照片采集'
lhand= capCreateCaptureWindowA(lpszName,262144+12582912+1073741824+268435456,0,0,200,200,ul_ll,0)
if lhand<> 0 then
Send(lhand, WM_CAP_SET_CALLBACK_VIDEOSTREAM,0,0);
Send(lhand, WM_CAP_SET_CALLBACK_ERROR, 0,0);
Send(lhand, WM_CAP_SET_CALLBACK_STATUSA, 0,0);
Send(lhand, WM_CAP_DRIVER_CONNECT, 0,0);
Send(lhand, WM_CAP_SET_SCALE,1,0);
Send(lhand, WM_CAP_SET_PREVIEWRATE, 66, 0);
Send(lhand, WM_CAP_SET_OVERLAY, 1, 0);
Send(lhand, WM_CAP_SET_PREVIEW, 1, 0);
end if