|
Thank You for ur reply.
I am new to directshow.I am trying to write an application to capture video from web cam.
I am getting ICaptureGraphBuilder2 undeclared identifier.
I have added the Dshow.h to my code
I have added the Quartz.lib Strmiids.lib strmbasd.lib wmvcore.lib wmstub.lib
in the project settings
But when i compile my code I am getting the following errors:
D:\DownLoad\LiveVideo\CaptureVideo.cpp(10) : warning C4651: '/D_MBCS __cplusplus' specified for precompiled header but not for current compile
d:\download\livevideo\capturevideo.h(114) : error C2143: syntax error : missing ';' before '*'
d:\download\livevideo\capturevideo.h(114) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
d:\download\livevideo\capturevideo.h(114) : error C2501: 'm_pCapture' : missing storage-class or type specifiers
d:\download\livevideo\capturevideo.h(122) : error C2143: syntax error : missing ';' before '*'
d:\download\livevideo\capturevideo.h(122) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
d:\download\livevideo\capturevideo.h(122) : error C2501: 'm_pCaptureMoniker' : missing storage-class or type specifiers
D:\DownLoad\LiveVideo\CaptureVideo.cpp(33) : error C2065: 'm_pCapture' : undeclared identifier
D:\DownLoad\LiveVideo\CaptureVideo.cpp(40) : error C2065: 'm_pCaptureMoniker' : undeclared identifier
D:\DownLoad\LiveVideo\CaptureVideo.cpp(104) : error C2065: 'CLSID_CaptureGraphBuilder2' : undeclared identifier
D:\DownLoad\LiveVideo\CaptureVideo.cpp(105) : error C2065: 'IID_ICaptureGraphBuilder2' : undeclared identifier
D:\DownLoad\LiveVideo\CaptureVideo.cpp(315) : error C2065: 'LONG_PTR' : undeclared identifier
D:\DownLoad\LiveVideo\CaptureVideo.cpp(315) : error C2059: syntax error : ')'
D:\DownLoad\LiveVideo\CaptureVideo.cpp(316) : error C2143: syntax error : missing ';' before '{'
D:\DownLoad\LiveVideo\CaptureVideo.cpp(342) : error C2227: left of '->SetFiltergraph' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(381) : error C2227: left of '->RenderStream' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(442) : error C2065: 'DWORD_PTR' : undeclared identifier
D:\DownLoad\LiveVideo\CaptureVideo.cpp(442) : error C2146: syntax error : missing ')' before identifier 'pUnkGraph'
D:\DownLoad\LiveVideo\CaptureVideo.cpp(443) : error C2059: syntax error : ')'
D:\DownLoad\LiveVideo\CaptureVideo.cpp(509) : error C2227: left of '->Release' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(538) : error C2227: left of '->Release' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(713) : error C2227: left of '->SetFiltergraph' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(721) : error C2227: left of '->RenderStream' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(862) : error C2059: syntax error : ')'
D:\DownLoad\LiveVideo\CaptureVideo.cpp(863) : error C2143: syntax error : missing ';' before '{'
D:\DownLoad\LiveVideo\CaptureVideo.cpp(868) : error C2065: 'EC_DEVICE_LOST' : undeclared identifier
D:\DownLoad\LiveVideo\CaptureVideo.cpp(868) : error C2051: case expression not constant
D:\DownLoad\LiveVideo\CaptureVideo.cpp(920) : error C2146: syntax error : missing ')' before identifier 'pUnkGraph'
D:\DownLoad\LiveVideo\CaptureVideo.cpp(921) : error C2059: syntax error : ')'
D:\DownLoad\LiveVideo\CaptureVideo.cpp(1001) : error C2227: left of '->FindInterface' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(1005) : error C2227: left of '->FindInterface' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(1067) : error C2227: left of '->FindInterface' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(1071) : error C2227: left of '->FindInterface' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(1145) : error C2227: left of '->FindInterface' must point to class/struct/union
D:\DownLoad\LiveVideo\CaptureVideo.cpp(1149) : error C2227: left of '->FindInterface' must point to class/struct/union
LiveVideo.cpp
D:\DownLoad\LiveVideo\LiveVideo.cpp(4) : warning C4651: '/D_MBCS __cplusplus' specified for precompiled header but not for current compile
d:\download\livevideo\capturevideo.h(114) : error C2143: syntax error : missing ';' before '*'
d:\download\livevideo\capturevideo.h(114) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
d:\download\livevideo\capturevideo.h(114) : error C2501: 'm_pCapture' : missing storage-class or type specifiers
d:\download\livevideo\capturevideo.h(122) : error C2143: syntax error : missing ';' before '*'
d:\download\livevideo\capturevideo.h(122) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
d:\download\livevideo\capturevideo.h(122) : error C2501: 'm_pCaptureMoniker' : missing storage-class or type specifiers
LiveVideoDlg.cpp
D:\DownLoad\LiveVideo\LiveVideoDlg.cpp(4) : warning C4651: '/D_MBCS __cplusplus' specified for precompiled header but not for current compile
d:\download\livevideo\capturevideo.h(114) : error C2143: syntax error : missing ';' before '*'
d:\download\livevideo\capturevideo.h(114) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
d:\download\livevideo\capturevideo.h(114) : error C2501: 'm_pCapture' : missing storage-class or type specifiers
d:\download\livevideo\capturevideo.h(122) : error C2143: syntax error : missing ';' before '*'
d:\download\livevideo\capturevideo.h(122) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
d:\download\livevideo\capturevideo.h(122) : error C2501: 'm_pCaptureMoniker' : missing storage-class or type specifiers
Generating Code...
Error executing cl.exe.
Please help me
S.Yamini
|
|
|
|
|
You must first these interfaces for VC++ then use of lib files,but I think maybe you dont have include files on your system did you search on your computer for see does these filex exist on your computer or no?
|
|
|
|
|
You need to start with a good solid Windows application project.
I would create a new one with the wizard.
If you're on Visual C++ 6.0, I'm not sure what issues you'll have. You may want to post a
question to 6.0 users about using the latest platform SDK with that version of C++.
Your project settings and build environment settings need to be solid for any Windows project,
especially when using DirectShow, DirectX, etc.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the number 3
|
|
|
|
|
Can anyone help me please to change the bar color of an XP styled
CProgressCtrl please...
Thanx'n'Advance
|
|
|
|
|
|
Thanx for replyin....
I have tried it.
send->m_ProgressSend.SendMessage(PBM_SETBARCOLOR,0,RGB(255,0,0));
This seems to work only if i dont use xp style.
is thr any other way out????
Thanx'n'advance
|
|
|
|
|
|
Thank u...
i already have a copy of processviewer with me...
but i would like a brief info about how its achieved ....
thanx'n'advance
|
|
|
|
|
See if this helps.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello everyone!
I'm trying to enumerate all the paths on my C:\ drive. I want this:
C:
C:\folder
C:\folder\subfolder
C:\folder\subfolder\subsubfolder
C:\folder\subfolder\subsubfolder\etc
...but instead I get this:
C:
C:\folder
C:\folder\.
C:\folder\.\.
C:\folder\.\.\.
What's the correct way of doing this? I'm using FindFirstFile and FindNextFile, not using MFC.
Thanks people!
Windows Calculator told me I will die at 28.
|
|
|
|
|
See this illustration from MSDN, the part you are missing in colored in red...
#include <afx.h>
#include <iostream>
using namespace std;
void Recurse(LPCTSTR pstr)
{
CFileFind finder;
CString strWildcard(pstr);
strWildcard += _T("\\*.*");
BOOL bWorking = finder.FindFile(strWildcard);
while (bWorking)
{
bWorking = finder.FindNextFile();
<code>
<code> if (finder.IsDots())
continue;</code>
if (finder.IsDirectory())
{
CString str = finder.GetFilePath();
cout << (LPCTSTR) str << endl;
Recurse(str);
}
}
finder.Close();
}
void main()
{
if (!AfxWinInit(GetModuleHandle(NULL), NULL, GetCommandLine(), 0)
cout << "panic!" << endl;
else
Recurse(_T("C:"));
} A dot(.) indicates current directory and a dot dot(..) indicates parent directory. So you need to ignore these two entries.
|
|
|
|
|
Is there any way to do this without MFC and C++ (just plain C & Win32)?
Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Lord Kixdemp wrote: Is there any way to do this without MFC and C++ (just plain C & Win32)?
Yeah, the source code of CFileFind::IsDots is as follows, now maybe you know how to do it...
BOOL CFileFind::IsDots() const
{
ASSERT(m_hContext != NULL);
ASSERT_VALID(this);
BOOL bResult = FALSE;
if (m_pFoundInfo != NULL && IsDirectory())
{
LPWIN32_FIND_DATA pFindData = (LPWIN32_FIND_DATA) m_pFoundInfo;
if (pFindData->cFileName[0] == '.')
{
if (pFindData->cFileName[1] == '\0' ||
(pFindData->cFileName[1] == '.' &&
pFindData->cFileName[2] == '\0'))
{
bResult = TRUE;
}
}
}
return bResult;
}
|
|
|
|
|
When you're enumerating, skip any dirs named "." and ".."
|
|
|
|
|
Does MS Chart control supports unicode characters?
I want to set Legends for MSChart control in different languages.
But when I am trying any language other than english,the MSChart control showing garbage values insted of provided string......
|
|
|
|
|
Hi,
Im trying to make a word game. But im kinda stuck with how to hussle the letters.
This is the code i got so far:
char letters[] = {'a', 'v', 'e', 'd', 'k', 'u', 'r', 'n', 'e'};
for(char * c = letters; c < &letters[sizeof(letters)]; c++)
{
}
Im trying to search all possible letter combinations starting with a word containing 2 letters and max 9.
After that, i'll compare the words it found with the dictionary so that the user knows if the word exist or not.
But comparing wont be a problem. The problem right now is to search all possible word combinations.
Anyone got some kind of an algorithm for this?
Thanks in advance!
|
|
|
|
|
You can use recursion, for instance.
You could also have a look at STLs and some algorithms for handling strings, combination, permutations,...
As a side note,
Yustme wrote: c < &letters[sizeof(letters)]
this is freaking code.
|
|
|
|
|
Hi,
I found this: c < &letters[sizeof(letters)] , on the net, was looking what it would give me, since array's dont have .size() method.
|
|
|
|
|
Here a better way, IMHO, to retrieve the size of an array:
char array[] = {1,2,3};
int size = sizeof(array)/sizeof(array[0]);
|
|
|
|
|
Hi,
I fixed that a few hours ago, thank you
|
|
|
|
|
This takes me back. I have uploaded jumble.zip, which is a word game much like you describe. The code is hideous, and only covers words of 4 - 7 chars in length. The basic idea of the game is to unscramble letters to find the word. For example, if you entered
jumble eraop it would output "opera". I'm sure you could improve the code 1000%, but it's fast because the dictionary is split into files of specific word lengths. If you had a decent dictionary, it would be trivial to do the same, for words of 2 - 9. Let me know how it turns out.
|
|
|
|
|
Hi,
I got a dictionary in a plain text format.
Thank you for the sample you gave me.
I'll let you know how it'll turn out
|
|
|
|
|
Hi,
I found an algorithm which was used for an int array.
I modified it so i can use it for my char array.
It works good but not as how i wanted it to work.
This is how it looks like right now:
<br />
void permute(char *v, const int start, const int n);<br />
void print(const char *v, const int size);<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
char v[] = {'a', 'v', 'e', 'd', 'k', 'u', 'r', 'n', 'e'};<br />
permute(v, 0, sizeof(v)/sizeof(char));<br />
<br />
system("pause");<br />
return 0;<br />
}<br />
<br />
void print(const char *v, const int size)<br />
{<br />
if (v != 0) <br />
{<br />
for (int i = 0; i < size; i++) <br />
{<br />
cout << v[i];<br />
}<br />
cout << endl;<br />
}<br />
}
<br />
<br />
void permute(char *v, const int start, const int n)<br />
{ <br />
if (start == n-1)<br />
print(v, n);<br />
<br />
else <br />
{<br />
for (int i = start; i < n; i++) <br />
{<br />
char tmp = v[i];<br />
<br />
v[i] = v[start];<br />
v[start] = tmp;<br />
permute(v, start+1, n);<br />
v[start] = v[i];<br />
v[i] = tmp;<br />
}<br />
}<br />
}<br />
It's making letter combinations with only all letters.
It should actually start with 2 letters and then continue until all 9 letter combinations are found.
|
|
|
|
|
Why don't you do something clever like computing the hash of your letter combinations / words, but do it in a way that is independent of letter order. The hash value of the jumbled combination would match the hash value of the unjumbled word. Then you would only have to search the (hopefully) few words with matching hash values.
One way you could do this would be to use a standard hash routine, but sort the letters in the word into alphabetical order prior to hashing them.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
How could I get the Instance Handle from another Process ID?
Maybe the Process has no any windows, so I can't use the GetWindowLong API.
And I know nothing about the Module Name of the third Process, so I can't use the GetModuleHandle API,too.
So,how could I get the Instance Handle from another Process ID?Or how could I get the Module Name of the third Process,that I can use the GetModuleHandle API for it?
|
|
|
|