Thread: Question about capDlgVideoSource

  1. #1
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485

    Question about capDlgVideoSource

    I am having a problem with the capDlgVideoSource . My problem is that my program only displays 2 of the 3 possible menus in the pop up menu from capDlgVideoSource.

    MSDN says:
    The capDlgVideoSource macro displays a dialog box in which the user can control the video source. The Video Source dialog box might contain controls that select input sources; alter the hue, contrast, brightness of the image; and modify the video quality before digitizing the images into the frame buffer. You can use this macro or explicitly send the WM_CAP_DLG_VIDEOSOURCE message.
    I know that my video source supports all the menus (the one I really need is the one for selecting source, and that is the one that is missing), as I get them all in other applications.

    Here is how I call the capDlgVideoSource:
    Code:
    	capDriverGetCaps(hWndCapWindow, &CapDrvCaps, sizeof (CAPDRIVERCAPS));
    	if (CapDrvCaps.fHasDlgVideoSource) 
    		capDlgVideoSource(hWndCapWindow);
    And here is how I create hWndCapWindow:
    Code:
    // Create the capture window
    hWndCapWindow = capCreateCaptureWindow( TEXT("CaptureWindow"), WS_CHILD| WS_VISIBLE| SS_SIMPLE | WS_EX_LAYERED,
    								320,50,	640,480,hWnd, MAINWIN_ID);
    
     SetLayeredWindowAttributes( hWndCapWindow, NULL, 150,NULL);   
    
    // Now that we have created the capture panel we can connect the first driver
    if(capDriverConnect(hWndCapWindow,0) == 0)
    	return false;
    
    capPreviewRate(hWndCapWindow,60);  
    capPreview(hWndCapWindow,TRUE);
    Any ideas?

  2. #2
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485
    An other thing that is weird is the my programs fails to connect to a webcam if there is more then one in the machine.

    With one webcam connected, this work,
    but it returns false if two or more is connected.
    Code:
    	// Now that we have created the capture panel we can connect the first driver
    	if(capDriverConnect(hWndCapWindow,0) == 0)
    		return false;

  3. #3
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485
    Ok, I found out what the problem was. It by far the most "random" bug I have been so far.

    Compiling the program on Windows XP solved the problem( Everything the same, just moved the project folder to a USB pen). The program works under Vista, it just cant be compiled there...

    Anyone knows why?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM