473,508 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

avicap32.dll issues (Is Ken Tucker Around?)

Hello

I am using a web cam service that saves images every five minutes based
off the example given by Ken Tucker. (hopefully I can catch him!) It
works great for the most part.

I need to handle a situation if the camera, or connection to the camera
become interupted. I am connecting through a device called a "dazzle"
which for some reason or another causes a few connection problems here
and there.

If the camera goes offline the image does not update, and the preview
window becomes frozen with the last frame before the connection was
interupted.

I noticed in the CAPSTATUS structure a few properties I could test for
to see if the image is "live". The problem is that "fLiveWindow" always
returns 1...even on a preview window with a still image. There is
another property "fCapturingNow" but it always returns 0. I could even
use "dwCurrentVideoFrame" and see if the count stopped but that too
always returns 0. What am I missing? How can I test if the preview
window has a live or moving image?

Public Structure CAPSTATUS
Dim uiImageWidth As Integer
Dim uiImageHeight As Integer
Dim fLiveWindow As Integer
Dim fOverlayWindow As Integer
Dim fScale As Integer
Dim ptScroll As POINTAPI
Dim fUsingDefaultPalette As Integer
Dim fAudioHardware As Integer
Dim fCapFileExists As Integer
Dim dwCurrentVideoFrame As Integer
Dim dwCurrentVideoFramesDropped As Integer
Dim dwCurrentWaveSamples As Integer
Dim dwCurrentTimeElapsedMS As Integer
Dim hPalCurrent As Integer
Dim fCapturingNow As Integer
Dim dwReturn As Integer
Dim wNumVideoAllocated As Integer
Dim wNumAudioAllocated As Integer
End Structure

I use the following to access the structure...

Dim s As CAPSTATUS

bReturn = SendMessage(hHwnd, WM_CAP_GET_STATUS, Marshal.SizeOf(s), s)

Thanks a million for any assistance!

Thanks,
Jeremy

Nov 21 '05 #1
2 2812
Function capGetStatus(ByVal lwnd As Integer, ByVal s As Integer, ByVal
wSize As Short) As Boolean
capGetStatus = SendMessage(lwnd, WM_CAP_GET_STATUS, wSize, s)
End Function

i haven't tried fLiveWindow yet. because i'm using winXp but doesn't
have capture card yet :-(
regards,

ken tucker is working on website project
regards

Jeremy wrote:
Hello

I am using a web cam service that saves images every five minutes based
off the example given by Ken Tucker. (hopefully I can catch him!) It
works great for the most part.

I need to handle a situation if the camera, or connection to the camera
become interupted. I am connecting through a device called a "dazzle"
which for some reason or another causes a few connection problems here
and there.

If the camera goes offline the image does not update, and the preview
window becomes frozen with the last frame before the connection was
interupted.

I noticed in the CAPSTATUS structure a few properties I could test for
to see if the image is "live". The problem is that "fLiveWindow" always
returns 1...even on a preview window with a still image. There is
another property "fCapturingNow" but it always returns 0. I could even
use "dwCurrentVideoFrame" and see if the count stopped but that too
always returns 0. What am I missing? How can I test if the preview
window has a live or moving image?

Public Structure CAPSTATUS
Dim uiImageWidth As Integer
Dim uiImageHeight As Integer
Dim fLiveWindow As Integer
Dim fOverlayWindow As Integer
Dim fScale As Integer
Dim ptScroll As POINTAPI
Dim fUsingDefaultPalette As Integer
Dim fAudioHardware As Integer
Dim fCapFileExists As Integer
Dim dwCurrentVideoFrame As Integer
Dim dwCurrentVideoFramesDropped As Integer
Dim dwCurrentWaveSamples As Integer
Dim dwCurrentTimeElapsedMS As Integer
Dim hPalCurrent As Integer
Dim fCapturingNow As Integer
Dim dwReturn As Integer
Dim wNumVideoAllocated As Integer
Dim wNumAudioAllocated As Integer
End Structure

I use the following to access the structure...

Dim s As CAPSTATUS

bReturn = SendMessage(hHwnd, WM_CAP_GET_STATUS, Marshal.SizeOf(s), s)

Thanks a million for any assistance!

Thanks,
Jeremy

Nov 21 '05 #2
Thanks for your reply Supra,

I read an earlier discussion between you and Henry Wu:

http://groups-beta.google.com/group/...0f363163cce7d1

Ken gave the following solution (which is what I am using to update
CAPSTATUS):

Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As
Integer, _
ByRef lParam As CAPSTATUS) As Boolean

Dim bReturn As Boolean
Dim wSize As Integer
Dim s As CAPSTATUS
bReturn = SendMessage(hHwnd, WM_CAP_GET_STATUS,
Marshal.SizeOf(s), s)
Debug.WriteLine(String.Format(*"Video Size {0} x {1}",
s.uiImageWidth, s.uiImageHeight))

Of course not the Debug.WriteLine statement. Since fLiveWindow always
returns true ("1") even with the camera disconnected I am either using
it incorrectly, or it simply has limitations. I am guessing I am using
it incorrectly because many (not all) of the other CAPSTATUS structure
values return 0 no matter what the preview window state.

Is there an event I can use that will fire if the connection status to
the camera changes?

Thanks,
Jeremy

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1321
by: Shelly | last post by:
I am facing issues in Toolbar in VB .NET: 1) There is nothing like disabled image list in toolbar of VB .NET. If I disable button on toolbar then I am not able to show disabled image even by...
2
2267
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup...
4
1971
by: Robin Tucker | last post by:
Hi, I'm currently implementing a database with a tree structure in a table. The nodes in the tree are stored as records with a column called "Parent". The root of the tree has a "NULL" parent....
2
1654
by: Robin Tucker | last post by:
I have a DLL that hands me an HGLOBAL handle to a blob of memory containing a WAV file (don't ask what the app is!). I figured I could play it with winmm.dll PlaySound or sndPlaySound...
4
1405
by: ElenaR | last post by:
I am having two issues with my datagrid. First, my column headers are not displaying. Second, the grid runs and displays correctly (except the headers) the first time. When the grid runs for the...
7
1188
by: Supra | last post by:
hi ken tucker, how will i do in vb.net? in vb6 i have no problem. i have rewritten in vb.net but i got white blank form. i am doing irc chat project similar mirc chat. in vb6 class module (not...
3
8109
by: Workgroups | last post by:
I'm writing a piece of video software, sort of like a webcam, that's meant to show a preview on the screen from any WDM capable cam. I want to give the user RGB sliders, and process each frame by...
4
3695
by: Andrew Kidd | last post by:
Is there any reason that VS 2005 only selects some project to rebuild when I hit the "run debugger" (F5)? We have a solution with 12 projects in it, and I'm debugging one of them right now. I...
1
3192
by: Macias | last post by:
Hi, I'm using avicap32 to capture video from my webcam, but I've a problem. I can cerate preview in ex. in picturebox component, but I need to get image from camera to Bitmap or Image component,...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.