I am getting 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
-
I am trying to capture video from web cam.I am using ICaptureGraphBuilder2. I am getting compilation error 'ICaptureGraphBuilder2' : missing storage-class or type specifiers 'CLSID_CaptureGraphBuilder2' : undeclared identifier I am using VC6 and visual studio 2003 I have install the directx sdk I have include the dshow.h I have included the lib files in project settings. Quartz.lib Strmiids.lib strmbasd.lib wmvcore.lib wmstub.lib Msvcrtd.libWinmm.lib I have included the paths in the tools->options->directories but after doing all this I am getting this compilation error messages. Please any body help me. S.Yamini
-
I am trying to capture video from web cam.I am using ICaptureGraphBuilder2. I am getting compilation error 'ICaptureGraphBuilder2' : missing storage-class or type specifiers 'CLSID_CaptureGraphBuilder2' : undeclared identifier I am using VC6 and visual studio 2003 I have install the directx sdk I have include the dshow.h I have included the lib files in project settings. Quartz.lib Strmiids.lib strmbasd.lib wmvcore.lib wmstub.lib Msvcrtd.libWinmm.lib I have included the paths in the tools->options->directories but after doing all this I am getting this compilation error messages. Please any body help me. S.Yamini
-
the Class ICaptureGraphBuilder2 is defined in strmif.h; and the CLSID_CaptureGraphBuilder2 is defined in uuids.h
I tried it with visual studio 2005 and it works great. Thanks for ur help. \ Can i know how can I capture and store the picture streams. S.Yamini
-
I tried it with visual studio 2005 and it works great. Thanks for ur help. \ Can i know how can I capture and store the picture streams. S.Yamini
I wrote below function in VC6 one year ago, maybe it can give you some hints. BOOL CMyClass::CaptureImage(LPCSTR szFileName) { if (pVMRWindowlessControl== NULL) return FALSE; BYTE* lpImage = NULL; if (pVMRWindowlessControl->GetCurrentImage(&lpImage) == S_OK) { BITMAPFILEHEADER hdr; DWORD dwSize, dwWritten; LPBITMAPINFOHEADER pDib = (LPBITMAPINFOHEADER)lpImage; //创建文件供写入 HANDLE hFile = CreateFile(szFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (hFile == INVALID_HANDLE_VALUE) return FALSE; //初始化BITMAP文件头 dwSize = DibSizeImage(pDib); hdr.bfType = BFT_BITMAP; hdr.bfSize = dwSize + sizeof(BITMAPFILEHEADER); hdr.bfReserved1 = 0; hdr.bfReserved2 = 0; hdr.bfOffBits = (DWORD)sizeof(BITMAPFILEHEADER) + pDib->biSize + DibPaletteSize(pDib); //写入文件头及内容 WriteFile(hFile, (LPCVOID)&hdr, sizeof(BITMAPFILEHEADER), &dwWritten, 0); WriteFile(hFile, (LPCVOID)pDib, dwSize, &dwWritten, 0); CloseHandle(hFile); CoTaskMemFree(lpImage); } return TRUE; }
-
I wrote below function in VC6 one year ago, maybe it can give you some hints. BOOL CMyClass::CaptureImage(LPCSTR szFileName) { if (pVMRWindowlessControl== NULL) return FALSE; BYTE* lpImage = NULL; if (pVMRWindowlessControl->GetCurrentImage(&lpImage) == S_OK) { BITMAPFILEHEADER hdr; DWORD dwSize, dwWritten; LPBITMAPINFOHEADER pDib = (LPBITMAPINFOHEADER)lpImage; //创建文件供写入 HANDLE hFile = CreateFile(szFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (hFile == INVALID_HANDLE_VALUE) return FALSE; //初始化BITMAP文件头 dwSize = DibSizeImage(pDib); hdr.bfType = BFT_BITMAP; hdr.bfSize = dwSize + sizeof(BITMAPFILEHEADER); hdr.bfReserved1 = 0; hdr.bfReserved2 = 0; hdr.bfOffBits = (DWORD)sizeof(BITMAPFILEHEADER) + pDib->biSize + DibPaletteSize(pDib); //写入文件头及内容 WriteFile(hFile, (LPCVOID)&hdr, sizeof(BITMAPFILEHEADER), &dwWritten, 0); WriteFile(hFile, (LPCVOID)pDib, dwSize, &dwWritten, 0); CloseHandle(hFile); CoTaskMemFree(lpImage); } return TRUE; }
Thanks.After trying it I will let u know S.Yamini