Thread: implicit conversion

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    7

    implicit conversion

    I'm trying to compile a program. The following line of code:
    hfDefault = GetStockObject(DEFAULT_GUI_FONT);
    produces the "[WARNING] ANSI C++ forbids implicit conversion from 'void' in assignmnent error" How do I resolve this?

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    HFONT hfDefault = (HFONT) GetStockObject(DEFAULT_GUI_FONT);

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    7

    thanx golfinguy4

    Thank you golfinguy4. I thought that this problem was related to a data type issue ( i.e. int, char ect.) Use of HFONT in this way is new to me, but your suggestion does resolve my problem. ...cj56

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  3. Header File Question(s)
    By AQWst in forum C++ Programming
    Replies: 10
    Last Post: 12-23-2004, 11:31 PM
  4. implicit conversion not working
    By Mr_Jack in forum C++ Programming
    Replies: 4
    Last Post: 03-09-2004, 10:50 AM
  5. Error: Implicit conversion from void*
    By Unregistered in forum Windows Programming
    Replies: 5
    Last Post: 12-12-2001, 02:38 PM