|
rahul_31366 wrote: I have to change the permissions of of my client application for all users
This is usely no good design. But I reckon it depends on what you are trying to achieve. Any more detail ?
|
|
|
|
|
Hi, I'm a newbee in programming world and I learn to program in C++ by analyzing source codes. I don't know whether this is good idea but... Anyway the reason why I posted this message here because I have a problem. Whenever I download someones source code ( mainly simple games like tetris) there is included header file called graphics.h. When I compile this source code it reports me that it can't find such header file. What is the problem? I mean I know that i don't have such header file but why? I'm using Visual Studio 6 and VS 2005.
|
|
|
|
|
Do you have this file on your computer?
|
|
|
|
|
You cannot find graphic.h when you try to compile with visual studio because it is a borland extension. Microsoft uses a different one, so is gnu etc etc.
Try compiling with Borland Builder it should work...
Downloading someone's source code and trying to compile it with vis studio is not enough. You have to take into account which platform was used to write the program. For example you could try download a game which was written for Linux and try to compile it in visual studio. It will most certainly fail because it will use libraries and extensions that were only developed for the linux system.
|
|
|
|
|
I think graphics.h is a part of Borland Turbo C++. It does not come with MS Visual studio.
You could install Turbo C++ 3.0 etc to compile the code.
Also you could port it to gcc to run on *nix based systems:
http://www.sandroid.org/TurboC/[^]
this is this.
|
|
|
|
|
I am trying to capture a video from web cam but I am getting error 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
Can any one help me how to use DirectShow. I have already include the Dshow.h and Strmiids.lib. but still I am geting error message
S.Yamini
|
|
|
|
|
Did you sww that forum,I test ICaptureGraphBuilder2 with my compiler when I include that headers file it doesnt any problem,whats your compiler?
|
|
|
|
|
If it is working for u it is great to hear that. I am using visual studio 6.Can i know what complier u r using and what header u have added to it.
S.Yamini
|
|
|
|
|
My compiler is VS2005 and I include "Dshow.h" and declare this interface CComPtr ICreateDevEnum pCde =NULL; and then use of CoCreateInstance.
|
|
|
|
|
Can u send me the whole code to my id
yamini.s@europlex.in
S.Yamini
|
|
|
|
|
What code? and I said to you on your previous message about that link.
|
|
|
|
|
Can I know what lib u added so that it can work.I am using Visual studio 2003.I am sorry for asking the code. But for past three days I am setting with this error. Can I know how u implemented it.
S.YAmini
|
|
|
|
|
I dont import any lib files I said I got an linker error that it seems I need to include a lib file but for that interface I include dshow.h and it worked.
|
|
|
|
|
R u using directX 9.0. What compiler u r using. Can u tell me what steps u have used
S.Yamini
|
|
|
|
|
Can I know what lib u added so that it can work.I am using Visual studio 2003.I am sorry for asking the code. But for past three days I am setting with this error. Can I know how u implemented it.
S.Yamini
|
|
|
|
|
Im not sure your problem will be solve with it or no but did you install DirectX 9.0 SDK ?
|
|
|
|
|
Yes I have installed it. can I know how to declare interface for my compiler. when it works for u it should work for me also. but it is not working.Please help me.
S.Yamini
|
|
|
|
|
I think its better yo show your code so if I know I answer to you of if other people knows then they answer to you.
|
|
|
|
|
#if !defined(AFX_CAPTUREVIDEO_H__057736B5_B61B_4850_8D82_E181E0B25B61__INCLUDED_)
#define AFX_CAPTUREVIDEO_H__057736B5_B61B_4850_8D82_E181E0B25B61__INCLUDED_
//--------------------------------------------------------------------------//
// Copyright DILLIP KUMAR KARA 2004
// You may do whatever you want with this code, as long as you include this
// copyright notice in your implementation files.
// Comments and bug Reports: codeguru_bank@yahoo.com
//--------------------------------------------------------------------------//
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CaptureVideo.h : header file
#include <atlbase.h>
#include <windows.h>
#include <dshow.h>
//
enum PLAYSTATE {STOPPED, PAUSED, RUNNING, INIT};
#define WM_GRAPHNOTIFY WM_USER+1
#ifndef SAFE_RELEASE
#define SAFE_RELEASE( x ) \
if ( NULL != x ) \
{ \
x->Release( ); \
x = NULL; \
}
#endif
/////////////////////////////////////////////////////////////////////////////
// CCaptureVideo window
class CCaptureVideo : public CWnd
{
// Construction
public:
CCaptureVideo();
// Attributes
public:
void StopCapture();
void StartTVTuner();
void StartWebcam();
void StartCompositeVideo();
void StartSVideo();
void RemoveGraphFromRot(DWORD pdwRegister);
void UnIntializeVideo();
HRESULT InitializeVideo(HWND hWnd);
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCaptureVideo)
//}}AFX_VIRTUAL
// Implementation
public:
void ResizeVideoWindow();
virtual ~CCaptureVideo();
// Generated message map functions
protected:
//{{AFX_MSG(CCaptureVideo)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
afx_msg HRESULT OnGraphNotify(WPARAM wp , LPARAM lp);
DECLARE_MESSAGE_MAP()
protected:
void ResizeVideoWindowMoniker();
void CloseInterfacesMoniker();
//----------------For Webcam-----------------//
void RemoveGraphFromRotMoniker(DWORD pdwRegister);
HRESULT AddGraphToRotMoniker(IUnknown *pUnkGraph, DWORD *pdwRegister);
HRESULT SetupVideoWindowMoniker();
HRESULT HandleGraphEventMoniker();
HRESULT FindCaptureDeviceMoniker(IMoniker** ppMoniker);
HRESULT AddCaptureMonikerToGraph(IMoniker* pMoniker);
HRESULT CaptureVideoByMoniker();
HRESULT GetInterfacesMoniker();
//------------------Video--------------------//
void DisplayMesg(TCHAR* szFormat, ...);
LRESULT ClearInterfaces(WPARAM wp, LPARAM lp);
void CloseInterfaces();
HRESULT AddGraphToRot(IUnknown* pUnkGraph, DWORD* pdwRegister);
HRESULT CaptureVideo();
HRESULT HandleGraphEvent();
HRESULT ChangePreviewState(int nShow);
HRESULT SetupVideoWindow();
HRESULT FindCaptureDevice(IBaseFilter** ppSrcFilter);
HRESULT GetInterfaces();
private:
UINT chSVideo, chCompVideo , chWebCam , chFullScreen , chAlwaysOnTop ;
int nVSourceCount;
int nAnalogCount;
CBrush m_emptyBrush;
DWORD m_dwGraphRegister;
BOOL bDevCheck;
HWND m_hApp;
//------------------Video--------------------//
IVideoWindow* m_pVW ;
IMediaControl* m_pMC ;
IMediaEventEx* m_pME ;
IGraphBuilder* m_pGraph ;
ICaptureGraphBuilder2* m_pCapture ;
IBaseFilter* pSrcF;
PLAYSTATE m_psCurrent;
//----------------For Webcam-----------------//
IVideoWindow* m_pVWMoniker ;
IMediaControl* m_pMCMoniker ;
IMediaEventEx* m_pMEMoniker ;
ICaptureGraphBuilder2* m_pCaptureMoniker ;
IFilterGraph2* m_pFilterGraph ;// IFilterGraph2 provides AddSourceFileForMoniker()
BOOL bVideo , bWebCam;
int vType;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CAPTUREVIDEO_H__057736B5_B61B_4850_8D82_E181E0B25B61__INCLUDED_)
I have copied my header file code but I am getting error only for ICaptureGraphBuilder2
S.Yamini
|
|
|
|
|
First I cant see any ICreateDevEnum on your code and second dont need to post all code and when post a code use of pre tag and can you show your declare of this interface on your cpp file,please.
|
|
|
|
|
'ICaptureGraphBuilder2' : missing storage-class or type specifiers
is the error i am getting in the before code i sent u. Can i know what do u mean by declare of the interface.Sorry I am new to directx
Cpp file
#include "stdafx.h"
#include "LiveVideo.h"
#include "CaptureVideo.h"
HRESULT hr;
if(m_pGraph == NULL){
// Create the filter graph
hr = CoCreateInstance (CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder, (void **) &m_pGraph);
if (FAILED(hr))
return hr;
}
else
return E_FAIL ;
if(m_pCapture == NULL) {
// Create the capture graph builder
hr = CoCreateInstance (CLSID_CaptureGraphBuilder2 , NULL, CLSCTX_INPROC,
IID_ICaptureGraphBuilder2, (void **) &m_pCapture);
if (FAILED(hr))
return hr;
}
else
return E_FAIL ;
S.Yamini
|
|
|
|
|
R u adding dshow.lib in the project settings. I am new to directx. I have added dshow.h and the other three lib in the project settings and downloaded the directx. What else I can do to solve the error
error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
S.Yamini
|
|
|
|
|
You must include dshow.h on your code and import lib files to your project.
|
|
|
|
|
DirectBlow? Have fun. Good luck. Sucks to be you.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Deja vu? Didn't I see this post twice yesterday?
Where are you getting these header files from?
You need the DirectShow SDK. It's part of the platform SDK.
Once you've installed that, make sure your build environment is setup properly.
This is explained in the documentation: Setting Up the Build Environment[^]
ICaptureGraphBuilder2 is defined in strmif.h, which is included by dshow.h.
Compiler errors really should be the least of your problems when using DirectShow.
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the number 3
|
|
|
|