Take a look in the AmCap Sample in the DXSDK DirectX 9.0 SDK It is a good example, but you need have some notion on DirectShow. []'s Marcos Vinícius
marcosvpp
Posts
-
Capture Video from tv Tunner card -
Menu at runtime (dynamic menu)It means that I always have to put some extra-code in my CDialog, CView or CFrameWnd? I can't just make an object that handle the menu messages without put any extra-code?
// MyApp.h ... private: CMyClass *MyObject; ... // MyApp.cpp ... BOOL MyApp::InitInstance() { // All I need? - All I want! MyObject = new CMyClass(); ... }
Thanks Anthony Marcos Vinícius -
Dymanic windowsYes, I understand!! I'm trying to create a MenuBar at runtime but all itens in the menu is GRAYED (disabled) when created!!! I don't know why?!?!? Maybe some help in your doubt helps in mine!!! :) Thanks Marcos Vinícius
-
Menu at runtime (dynamic menu)Yes, I try this, but the menu that I append is still grayed!!!
CMenu *Menu = Wnd->GetMenu(); hr = Menu->InsertMenu(Position, MF_BYPOSITION | MF_STRING | MF_POPUP | MF_ENABLED, (UINT)DevicesMenu->m_hMenu, TEXT("Devices")); Menu->Detach(); Wnd->DrawMenuBar();
The only way that they work properly is to add in the AppClass file MESSAGE_MAP the code:// file "MyApp.cpp" BEGIN_MESSAGE_MAP(CTe13App, CWinApp) //{{AFX_MSG_MAP(CTe13App) ON_COMMAND(ID_APP_ABOUT, OnAppAbout) ON_COMMAND(ID_PAUSE, OnPause) //}}AFX_MSG_MAP // My message map ON_COMMAND_RANGE(ID_MENU_DIALOG0, ID_MENU_DIALOG9, OnDialog) END_MESSAGE_MAP()
but I don't want to do this. I need to be App independent; to be an independent class!! Is there a way that adding a message map in my class, the app message map understand? Like this: // file "MyClass.cpp" BEGIN_MESSAGE_MAP(CVidCap, CWnd) ON_COMMAND_RANGE(ID_MENU_DIALOG0, ID_MENU_DIALOG9, OnDialog) END_MESSAGE_MAP() Thanks Marcos Vinícius Engenheiro Eletricista -
Menu at runtime (dynamic menu)Hi, I have a class (CVidCap) that I developed to grab frames from a Webcam and I want to make this a "dialog independent" class. When this class is created it populate a CMenu (MFC) object with all Webcam available in the system and i design a function that append this CMenu object in an application MenuBar. The problem is that when the CMenu object is attached, it is alweys GRAYED, and I can't handle any mouse button press in my class. I'm trying to handle the application events in my independent class without insert any code in the application MESSAGE_MAP. I was clearly?
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) //{{AFX_MSG_MAP(CMainFrame) ON_COMMAND(ID_TESTE_B, OnTesteB) //}}AFX_MSG_MAP END_MESSAGE_MAP()
I try to add a message map in my class but didn't work. :( If anybody could help, I'll appreciate! Thanks, and sory my english! :) Marcos Vinícius Engenheiro Eletricista