|
Um. Windows recognizes both webcams as in... they both have VFW drivers? Did you see the webcams listed in the listbox of this application?
|
|
|
|
|
Yes I can choose between two webcams in windows UI dialog .
but as mentioned above when I put the camIndex=1 it doesn't recognize it.
|
|
|
|
|
What windows UI dialog? Is it present in the SelCapDrvDlg in this application?
Set a breakpoint in main.cpp line 199. What are the indexes of the 2 webcams you are interested in?
|
|
|
|
|
it reaches the breakpoint when i=0 and it doesn't reach in i=1
|
|
|
|
|
And there we have it. One of your webcams only has a WDM driver. You would have to write a DirectShow application.
|
|
|
|
|
how can I write a DirectShow program , If you have time , please tell me .
thank you
|
|
|
|
|
If you have VC7+, download and install the latest Platform SDK. Go to http://tmhare.mvps.org/downloads.htm[^] to get the project files for the samples since Microsoft has for some reason stripped it out.
Then go have a look at the PlayCap sample application in "..\Program Files\Microsoft Platform SDK\Samples\Multimedia\DirectShow\Capture\PlayCap"
If you have VC6 though, you would have to grab an old DirectX SDK, maybe 2003 or 2004.
|
|
|
|
|
|
|
I dont Have visual C++ , I just have visual studio .NET and CBuilder And I prefer to write this program in CBuilder .
-- modified at 10:09 Thursday 4th May, 2006
|
|
|
|
|
|
|
i need help on chngin for loop in this file to while loop..plz solve this for me as soon as possible...i trien in many ways but cant...
#include <ctime> <br />
#include <iostream><br />
#include <string><br />
#include <algorithm><br />
#include <fstream><br />
using namespace std;<br />
<br />
time_t tmStart, tmEnd;<br />
<br />
<br />
<br />
void DoStuff()<br />
{<br />
tmStart = time(0);<br />
ifstream fin;<br />
fin.open("data.txt",ios::in);<br />
<br />
ofstream File("MyFile.txt",ios::out);<br />
<br />
<br />
char str[14];<br />
<br />
fin.getline(str,sizeof(str),'\n');<br />
<br />
<br />
string line(str);<br />
cout << str<<endl;<br />
<br />
<br />
<br />
for (int i=0; i<5000; ++i)<br />
{<br />
random_shuffle(line.begin(), line.end());<br />
File << "Randomised: " << line << endl;<br />
File << " : " << line << endl;<br />
File << " : " << line << endl;<br />
File << " : " << line << endl;<br />
File << " "<< endl;<br />
<br />
File << " "<< endl;<br />
<br />
<br />
<br />
tmEnd = time(0);<br />
cout << tmEnd-tmStart << " seconds (that was fast!)" << endl;<br />
<br />
} <br />
File.close ();<br />
fin.close ();<br />
<br />
}<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
DoStuff();<br />
<br />
return 0;<br />
<br />
}<br />
<br />
<br />
|
|
|
|
|
Mmmmh... At first glance, this is not even easy, it is trivial... smells like homework ... please post your code that does not work with your while attempt, and we will help you.
~RaGE();
|
|
|
|
|
i know its sumthing about this but i dont knw how to implement it..
{<br />
char str[2000];<br />
fstream file_op("c:\\test_file.txt",ios::in);<br />
while(!file_op.eof()) <br />
{<br />
file_op.getline(str,2000);<br />
cout <<str;<br />
} file_op.close();<br />
cout <<endl;<br />
<br />
|
|
|
|
|
Please, stop asking things you don't even understand. Take a C++ book and start reading it.
How will you learn if people make the complete program for you (this is what is happening right now, looking at the number of questions you already asked for such a trivial code snippet).
|
|
|
|
|
i am learning...give me any hint on this...
|
|
|
|
|
|
A good book. Every C++ programmer should read it.
Steve
|
|
|
|
|
|
I started reading it after already "knowing" C++: I thought I wouldn't learn much from it: I was wrong.
Steve
|
|
|
|
|
Stephen Hewitt wrote: I thought I wouldn't learn much from it: I was wrong.
Such as? Do you mind listing a few which you learned in addition from the book? Thanks.
Maxwell Chen
|
|
|
|
|
The main thing learnt from the book is to program in C++ in such a way that makes use of the language’s features in a natural manner. One of the major problems with many C++ programmers in my opinion (and the book's) is that they use C++, for the most part, as if it was simply a better C. It emphasizes the standard library and the STL. In also clarified a lot of language subtleties such as the fact that enum s have a range, for example. It explains a lot of things like which statements are portable, which result in implementation defined beaviour and which result in undefined behaviour (and the distinction between them). It explains the difference between C and C++. It is a good reference manual. It explains programming techniques as well as language and library issues. It also goes into problems such as how to manage a large software project. It's hard to list all the things you learnt from a book like this off the top of your head. My advice to any C++ programmer (and to employers) is to treat it as required reading.
Steve
|
|
|
|
|
Thank you for the comments.
I found some people (not too many) in CP who are good in STL during my 4-year membership, and you are among them. Thus I'm interested and I would like to hear your comment to Stroustrup's book.
I read those various readers' reviews on this book at Amazon site several years ago. Some said it a very good book, whereas the other felt it in poor writing skill.
For myself, my English wasn't really good but just so so when I bought this book in Nov 1998, the 1st time I started to learn programming from knowing nothing. So I spent 3 months go through another book first, "C++ from the ground up", which is in pretty plain English. Later I read Stroustrup's.
Personally I feel there two cons with this book:
1) Not really fits for newbies. The pace goes too fast from the basic.
2) Link references too often. That is: .... (refer to $2.5.3), ..... (refer to $3.1.1), ... It is apprehensible because he was trying to elaborate that much things in one book.
Except the above, it is really a very good book to me.
Maxwell Chen
|
|
|
|
|
so why didn't you tell me about this book before
i've been posting question's for quite some time in this forum
I'm a newbie and i asked if you know a good c++ reference book or site
many times. So do you recomend this book. Will i learn as much as you if i read it ?
|
|
|
|