Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Question about webcam

Posted on 2002-03-10
4
Medium Priority
?
1,858 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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

610 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