?
Solved

Question about webcam

Posted on 2002-03-10
4
Medium Priority
?
1,851 Views
Last Modified: 2008-02-01
I made a control that connects to the webcam.
The problem is that when trying to connect to the webcam if the webcam is already in use a screen comes up asking the user to select a different webcam device.

I am using this function to call the connect to the webcam device:

function capDriverConnect(ByVal hCapWnd as Long, Optional ByVal i as long = 0&) as Boolean
    capDriverConnect = SendMessageAsLong(hCapWnd, WM_CAP_DRIVER_CONNECT, i, 0&)
end function

So, basically what I want is a function to check if the specified web cam is in use or not; or else a function that tries to connect to the web device and if it is in use it will just not connect rather then prompt the user with a screen to select another device.
0
Comment
Question by:Joshyy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:PeteD
ID: 6854607
ping
0
 
LVL 1

Expert Comment

by:Smokintbird
ID: 6857237
Try this, it's got most of the code you're looking for...
it's more complicated than you're asking for, but it's also quite complete...

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=28493&lngWId=1

let me know if this suits your needs...
0
 
LVL 1

Author Comment

by:Joshyy
ID: 6861790
sorry Smokintbird... but I already made a web cam device ... the problem is that if the webcam device is already in use (by another program) when you start "your" program a screen comes up asking you to select a different web cam... it is this that i want to stop from happening.
0
 
LVL 1

Accepted Solution

by:
Smokintbird earned 400 total points
ID: 6862983
first off, the function you're using is calling "WM_CAP_DRIVER_CONNECT"...
the code you should be looking at, is the value of "WM_CAP_START" at the time it attempts to connect.
set a breakpoint after it gets that variable, and find out it's value when the device is in use and when it's not...

then simply put an if-then statement in to trap for the used state...
if used, then bail out or pop a message box or something...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question