Playing an AVI vedio on DAQfactoty screen


Recommended Posts

Hi I am working on an image processing project. i am using external Dlls specially dedicated to complex image processing. i have created applications using VB6 and C#. But i would prefer Daqfactory due to its ease and efficiency. My only problem is to use functions external to DAQfactory with the function extern.

To be specific i would like to know how to use the following functions from avicap32.dll to play a video on DAQfactory image component.

The following are examples on how i declare the functions in in visual basic 6.0.

Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Declare Function capCreateCaptureWindow Lib "avicap32.dll" Alias "capCreateCaptureWindowA" (ByVal a As String, ByVal b As Long, ByVal c As Integer, ByVal d As Integer, ByVal e As Integer, ByVal f As Integer, ByVal g As Long, ByVal h As Integer) As Long

This is how i use them to show a video on a picture box.

Dim temp As Long

hwdc = capCreateCaptureWindow("Dixanta Vision System", ws_child Or ws_visible, 0, 0, 320, 240, Picture1.hWnd, 0)

If (hwdc <> 0) Then

temp = SendMessage(hwdc, wm_cap_driver_connect, 0, 0)

temp = SendMessage(hwdc, wm_cap_set_preview, 1, 0)

temp = SendMessage(hwdc, WM_CAP_SET_PREVIEWRATE, 30, 0)

startcap = True

Else

MsgBox ("No Webcam found")

End If

Note in the above function it returns 0 (zero) if no error or and error number

If DAQfactory works well with this DLL then i will have no serious problems working with other dlls.

Please assist

Link to comment
Share on other sites

You can't use any DLL calls that require window handles. You don't have access to any window handles in DAQFactory. You need to find a function in the .dll that will take a single image and return that image data as an array of numbers. It can't use a callback and it can't use window handles. If need be, post the documentation that lists all the function prototypes for the dll.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.