implicit conversion

This is a discussion on implicit conversion within the C++ Programming forums, part of the General Programming Boards category; I'm trying to compile a program. The following line of code: hfDefault = GetStockObject(DEFAULT_GUI_FONT); produces the "[WARNING] ANSI C++ forbids ...

  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,136
    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, 10:31 PM
  4. implicit conversion not working
    By Mr_Jack in forum C++ Programming
    Replies: 4
    Last Post: 03-09-2004, 09:50 AM
  5. Error: Implicit conversion from void*
    By Unregistered in forum Windows Programming
    Replies: 5
    Last Post: 12-12-2001, 01:38 PM

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