LoadIcon using MingwTDM 64bit

This is a discussion on LoadIcon using MingwTDM 64bit within the Windows Programming forums, part of the Platform Specific Boards category; I am not a very experienced c++ programmer. I am using the MinGWTDM g++ compiler to create a 64bit unicode ...

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

    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,680
    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
    42
    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, 04:23 AM
  4. LoadIcon in win API window class
    By IdioticCreation in forum Windows Programming
    Replies: 6
    Last Post: 12-30-2006, 04:15 PM
  5. 64bit humawahjusit?
    By Dimeslime in forum C++ Programming
    Replies: 4
    Last Post: 03-06-2004, 01:25 AM

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