Menu

Porblem with icons

k k
2008-11-06
2012-09-26
  • k k

    k k - 2008-11-06

    when i try to change the default icon to something else i get the following error

    C:\Users\public\Desktop\gcc installation problem, cannot exec `cc1': No such file or directory.
    [Resource error] no resources
    C:\Users\Karim\Desktop\Makefile.win [Build Error] [Project1_private.res] Error 1
    What should i do now?
    i don't thing its a installation problem because i try it with one of the examples and it works.

     
    • Wayne Keen

      Wayne Keen - 2008-11-07

      Please get in the habit of NOT excerpting the error message. Please post your full Basic 3, the are covered in the thread titled "Please Read Before Posting a Question".

      Wayne

       
    • Ron McHugh

      Ron McHugh - 2008-11-07

      It looks like you dont have any resource files in your project...

      First you need to define the resource id in the projects header file (project.h).
      [code]

      ifndef PROJECT_H

      define PROJECT_H

      include <windows.h>

      define IDR_MAINFRAME 100

      endif / PROJECT_H /

      [/code]

      Then you need to define the resource in the projects resource script (project.rc).
      [code]

      include "project.h"

      IDR_MAINFRAME ICON "filename.ico"
      [/code]

      Now you can load and use the resource in the projects source file (project.cpp).
      [code]

      include "project.h"

      ...
      HICON hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDR_MAINFRAME));
      [/code]

      See MSDN for LoadIcon and other related ops.

       

      Related

      Code: code


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.