Adding an icon to FB app

New to FreeBASIC? Post your questions here.
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Postby Clyde » Feb 09, 2006 0:25

Get the same error in the Free Basic command prompt also.
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Postby Clyde » Feb 09, 2006 0:35

yep my bas projects are associated with FBIDE, still getting the error. :(
Fragmeister
Posts: 545
Joined: Nov 08, 2005 14:36

Postby Fragmeister » Feb 09, 2006 2:15

Try this:

Code: Select all

fbc sourcefile.bas resource.rc -s gui


That's how I do it. Also, might try removing that #define, I don't think it's necessary
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Postby Clyde » Feb 09, 2006 4:22

Im now beginning to think that a .rc file should have some kind of associated icon itself? And might be why its not either recognizing it as a special source file, or something like that. As im always greeted with it not being able to open it.

So brings me to ask, when you save the resource once entered into Notepad, with Save As and the option, all files. And then the name of it eg: thisresource.rc . do you in explorer then see an association symbol; or is it just as a notepad file symbol?

If the answer to the above is yes, then do you have any idea on how i can get them to be associated as an rc source file?

Hugest of thanks,
Clyde.
PlayerOne
Posts: 173
Joined: Aug 15, 2005 18:58
Location: UK

Postby PlayerOne » Feb 09, 2006 10:28

The .rc files are compiled by GoRC.exe, which is in your FreeBASIC\bin\win32 folder.

Perhaps it's not finding the icon file? Although it looks like it's not finding the .rc file. Are both in the same folder as your .bas files?
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Postby Clyde » Feb 09, 2006 13:36

Yes they are PlayerOne dude.
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Postby Clyde » Feb 09, 2006 14:08

And i just tried compiling with addicon.rc.txt and no errors found, but no icon. :( And it doesnt make the obj file.
yetifoot
Posts: 1710
Joined: Sep 11, 2005 7:08
Location: England
Contact:

Postby yetifoot » Feb 09, 2006 15:15

@clyde

what version FB are you using?

I'm sure i read somewhere in the forum that there was an issue where resource files weren't being passed in quotes. Although i would expect this would only affect files with a space in the filename, maybe this is the problem?
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Postby Clyde » Feb 09, 2006 15:40

Ahaha, thats brilliant. Working now, greatest.
( btw, big appologies for topic hijacking )

And a tip make sure if your using notepad to create resource files, that it is actually saving them as an .rc document and not as a txt doc. :)

As a concluding question. Once a resouce ie, an exe has been set to the executable. Say if you make changes, do you / me / farmer Giles, then have to compile again with the resource, or is it now set in stone from the first time around?
Imortis
Moderator
Posts: 1744
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Postby Imortis » Feb 09, 2006 16:02

farmer Giles


Tolkin Reference? Right on!
Fragmeister
Posts: 545
Joined: Nov 08, 2005 14:36

Postby Fragmeister » Feb 09, 2006 16:16

Say if you make changes, do you / me / farmer Giles, then have to compile again with the resource, or is it now set in stone from the first time around?

yes. Every time you compile, if you want the icon to show up, you must include the .rc file in the command line, because the .exe file is completely rewritten.
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Postby Clyde » Feb 09, 2006 18:58

Cool and thankyou.
Cheers, Clyde :)
BlackWizard
Posts: 73
Joined: Jan 21, 2006 21:32
Location: Poland

Postby BlackWizard » Feb 09, 2006 19:06

Hello, but how to change small icon, in the upper left corner of application?
thanks, BW.
Fragmeister
Posts: 545
Joined: Nov 08, 2005 14:36

Postby Fragmeister » Feb 09, 2006 19:26

Make sure that the name of your icon in your .rc file is FB_PROGRAM_ICON:

Code: Select all

FB_PROGRAM_ICON ICON myicon.ico

Also, try making your icon with an icon making program.
BlackWizard
Posts: 73
Joined: Jan 21, 2006 21:32
Location: Poland

Postby BlackWizard » Feb 09, 2006 19:38

ahhh this way....
It was said here....

sorry, I didn't saw it.
Last edited by BlackWizard on Sep 18, 2006 14:05, edited 1 time in total.

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 12 guests