Thread: SetMediaType problem

  1. #1
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195

    SetMediaType problem

    Code:
    this->MediaType.majortype = MEDIATYPE_Video;
    this->MediaType.subtype = MEDIASUBTYPE_RGB24;
    this->MediaType.formattype = FORMAT_VideoInfo;
     
    printf("SetMediaType...");
    hr = this->pGrabber->SetMediaType(&this->MediaType);
    if(FAILED(hr)){
       printf("FAILED.\n");
       return;
       }
    printf("done.\n");
    crashes during the call to set media type. pGrabber is valid from a previous call. The problem is I dont even get the report of FAILED. It literally crashes during the call.

    This might be associated with my using 2008 express and having to put in the MS recommended hack for Qedit.h, so i will try compiling it under codeblocks or something if I get time to install it. If I just skip setting the media type, then it works fine, but this same code works fine when compiled under 2005 (full version). Right now I am workign with a cheap camer that only supports 24 bit so its not an issue, but I plan on gettign a better camera that supports more fromats, so I need to be able to set the mediatype
    Last edited by abachler; 05-31-2008 at 08:32 AM.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Does it crash in a debug build? If so, step through and see if the value of "this" or "pGrabber" changes at some point prior to the crash.

    Treat each crash as new and exciting opportunity to hone your debugging skillz

    gg

  3. #3
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    I tested it in a debug build, and it doesnt crash, but the method still fails. I hate to spend $800 on VS.

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    >> I tested it in a debug build, and it doesnt crash...
    Ohhh, those are my favorite

    >> but the method still fails
    and hr is.....

    gg

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by abachler View Post
    I hate to spend $800 on VS.
    And why would you have to spend $800 on VS?
    At best, the Express edition can provide all debugging capabilities than Standard+ can.
    Besides, even if it crashes in Release, you can track down where it crashes. Although you may have to look at some assembly to know WTH is going on since it sometimes caches things in registers. VS is excellent at showing assembly, though.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by Elysia View Post
    And why would you have to spend $800 on VS?
    At best, the Express edition can provide all debugging capabilities than Standard+ can.
    Besides, even if it crashes in Release, you can track down where it crashes. Although you may have to look at some assembly to know WTH is going on since it sometimes caches things in registers. VS is excellent at showing assembly, though.
    apparently you didnt read the thread elysia. Its crashing on express edition and runs fine when compiled on the full version.

    Quote Originally Posted by codeplug
    and hr = ?
    ok code, sorry about that. the HR it is returning on failure in the debug version is
    E_OUTOFMEMORY, which doesnt make any sense.
    Last edited by abachler; 05-31-2008 at 12:11 PM. Reason: didnt have my coffee this mornign yet

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by abachler View Post
    hahaha, aparently you didnt read the thread elysia. Its crashing on express edition and runs fine when compiled on the full version so run along and play now.
    The only thing I see is that it runs fine on 2005 and not on 2008.
    Standard or not doesn't really matter.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. beginner problem
    By The_Nymph in forum C Programming
    Replies: 4
    Last Post: 03-05-2002, 05:46 PM