Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. What is wrong with this way of initializing vfw drivers?

What is wrong with this way of initializing vfw drivers?

Scheduled Pinned Locked Moved C / C++ / MFC
questiondebugging
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Redeemer dk
    wrote on last edited by
    #1

    ICINFO icinfo;
    HIC hic;

    icinfo.dwSize = sizeof(icinfo);
    icinfo.fccType = ICTYPE\_VIDEO;
    char szNoWideChar\[128\];
    
    for (int i = 0; ICInfo(ICTYPE\_VIDEO, i, &icinfo); i++)
    {
    	hic = ICOpen(icinfo.fccType, icinfo.fccHandler, ICMODE\_QUERY);
    	if (hic)
    	{
    		ICGetInfo(hic, &icinfo, sizeof(icinfo));
    
    		WideCharToMultiByte(CP\_ACP, 0, icinfo.szDescription, -1, szNoWideChar, sizeof szNoWideChar, NULL, NULL);
    		SendMessage(GetDlgItem(ghWnd, IDC\_COMPRESSORS), LB\_ADDSTRING, -1, (LPARAM)szNoWideChar);
    	}
    }
    

    This causes a user breakpoint the first time i reach the for (int i =... statement. Why? All input appreceated! -Rune Svendsen

    S 1 Reply Last reply
    0
    • R Redeemer dk

      ICINFO icinfo;
      HIC hic;

      icinfo.dwSize = sizeof(icinfo);
      icinfo.fccType = ICTYPE\_VIDEO;
      char szNoWideChar\[128\];
      
      for (int i = 0; ICInfo(ICTYPE\_VIDEO, i, &icinfo); i++)
      {
      	hic = ICOpen(icinfo.fccType, icinfo.fccHandler, ICMODE\_QUERY);
      	if (hic)
      	{
      		ICGetInfo(hic, &icinfo, sizeof(icinfo));
      
      		WideCharToMultiByte(CP\_ACP, 0, icinfo.szDescription, -1, szNoWideChar, sizeof szNoWideChar, NULL, NULL);
      		SendMessage(GetDlgItem(ghWnd, IDC\_COMPRESSORS), LB\_ADDSTRING, -1, (LPARAM)szNoWideChar);
      	}
      }
      

      This causes a user breakpoint the first time i reach the for (int i =... statement. Why? All input appreceated! -Rune Svendsen

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      Don't forget to zeroinit the structure.


      How low can you go ?
      (MS rant)

      R 1 Reply Last reply
      0
      • S Stephane Rodriguez

        Don't forget to zeroinit the structure.


        How low can you go ?
        (MS rant)

        R Offline
        R Offline
        Redeemer dk
        wrote on last edited by
        #3

        Already tried that, didn't work :( thanks anyway man.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups