Thread: LoadIcon using MingwTDM 64bit

  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    63

    LoadIcon using MingwTDM 64bit

    I am not a very experienced c++ programmer.
    I am using the MinGWTDM g++ compiler to create a 64bit unicode gui application.


    Everything compiles and runs fine if I comment out this line

    Code:
    wcx.hIcon= LoadIcon( hInst, MAKEINTRESOURCE( IDI_APPLICATION));
    with that line I get
    Code:
    error: cast from 'LPWSTR {aka wchar_t*}' to 'WORD {aka short unsigned int}' loses precision [-fpermissive]
    I would rather not use -fpermissive


    The app compiles fine using cl from the Win7.1SDK.


    Thanks for any tips.


    James

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    You don't have have to call MAKEINTRESOURCE(), just pass in IDI_APPLICATION directly and NULL instead of hInst.

    LoadIcon function (Windows)

    gg

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    63
    Thank you Codeplug. What stumped me was that cl from the Win 7.1 SDK compiled it just fine in a 64bit app

    James

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 64bit system can't run c++ !!!???
    By ameer.b in forum C++ Programming
    Replies: 7
    Last Post: 08-25-2009, 11:14 AM
  2. Divide 64bit number
    By freeindy in forum C Programming
    Replies: 4
    Last Post: 10-01-2007, 03:56 AM
  3. Dev C++ 64bit support
    By code2d in forum Tech Board
    Replies: 6
    Last Post: 01-03-2007, 05:23 AM
  4. LoadIcon in win API window class
    By IdioticCreation in forum Windows Programming
    Replies: 6
    Last Post: 12-30-2006, 05:15 PM
  5. 64bit humawahjusit?
    By Dimeslime in forum C++ Programming
    Replies: 4
    Last Post: 03-06-2004, 02:25 AM