VB6.FixedLengthString(100)是啥玩艺儿?
从这个网页中http://network.programming-in.net/articles/art7-3.asp
可以找到Dim lpszName As New VB6.FixedLengthString(100) ,这个语句有问题,我不懂得如何改,请帮忙
Sub MapWebcamToWindow(ByRef lWidth As Integer, ByRef lHeight As Integer, ByRef hWnd As Integer)
Dim lpszName As New VB6.FixedLengthString(100)
Dim bmp As BITMAPINFO
With bmp.bmiHeader
.biSize = Len(bmp.bmiHeader)
.biWidth = 320
.biHeight = 240
.biPlanes = 1
.biBitCount = 24
End With
capGetDriverDescriptionA(0, lpszName.Value, 100, Nothing, 100)
lwndC = capCreateCaptureWindowA(lpszName.Value, WS_VISIBLE Or WS_CHILD, 0, 0, lWidth, lHeight, hWnd, 0)
If capDriverConnect(lwndC, 0) Then
capPreviewRate(lwndC, 66)
capPreview(lwndC, True)
capSetVideoFormat(lwndC, bmp, Len(bmp))
SetWindowPos(lwndC, 0, 0, 0, bmp.bmiHeader.biWidth, bmp.bmiHeader.biHeight, SWP_NOMOVE Or SWP_NOZORDER)
End If
End Sub