`SetCooperativeLevel' undeclared (first use of this function)

This is a discussion on `SetCooperativeLevel' undeclared (first use of this function) within the Windows Programming forums, part of the Platform Specific Boards category; I am getting gobs of errors with this script: Code: IDirectDraw4::SetCooperativeLevel(hwnd, DDSCL_FULLSCREEN | DDSCL_ALLOWMODEX | DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT); It doesn't ...

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    `SetCooperativeLevel' undeclared (first use of this function)

    I am getting gobs of errors with this script:

    Code:
     IDirectDraw4::SetCooperativeLevel(hwnd, DDSCL_FULLSCREEN | DDSCL_ALLOWMODEX | DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT);
    It doesn't like anything I have in the second argument,
    Plus it doesn't even recognise the SetCooperativeLevel() function. Why is this?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,673
    > Plus it doesn't even recognise the SetCooperativeLevel() function. Why is this?
    The function doesn't exist
    You spelled it wrong
    You got the capitalisation wrong
    You chose the wrong build options (maybe it's conditionally compiled in)

    Find the function in the header file, check it's spelling, which class it's a member of, whether there are any #ifdef surrounding the function.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    As far as I remember, this function is not static. You need an instance of a class implementing IDirectDraw4 to call this function.

    Maybe you could consult a newer tutorial, DD is up to version 7 with a standard install of Win2K. The problem you have will persist though, it's a coding issue, not a version conflict.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 01:17 AM
  2. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  3. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  4. Consumer program
    By wise_ron in forum C Programming
    Replies: 11
    Last Post: 09-27-2006, 05:21 AM
  5. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 01:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21