File not found bclasses.ico

We encourage new members to introduce themselves here. Get to know one another and share your interests.
Hollo2712
Posts: 8
Joined: Sun Jan 31, 2021 9:50 am

File not found bclasses.ico

Post by Hollo2712 »

Hello at all,

I am a liitle bit stupid, but I ported a VO-Project to XSHARP, using some external tools like BCLASSES. Now I get the error "C:XIDEProjectswsVereinXbDefinesVersion (Info).rc(1) : error RC2135 : file not found: BCLASSES.ICO". The responding Sourceline is _BICOCLASSES ICON BCLASSES.ICO

Now I can't get any Info of how the XIDE resoveses thist file name with some Variable Path from the Project. I alrready tried to copy the necessary files in some directories in the project-path and/or used %ProjectPath%. But this error remains.
There must be something I do not recognize to set the right path for Resource-Files like Icons.

Can anyone give me a hint.

Many thanks

Horst
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

File not found bclasses.ico

Post by wriedmann »

Hi Horst,
please open that file (C:XIDEProjectswsVereinXbDefinesVersion (Info).rc) and look where the file is expected.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Hollo2712
Posts: 8
Joined: Sun Jan 31, 2021 9:50 am

File not found bclasses.ico

Post by Hollo2712 »

Hi Wolfgang,

this is the point: I don't know how to change the source in a manner, that the compiler finds the icon. The question is, which search-path is used by the compiler and which envrionmental variables ca be used to subreference a dircectory relative to the project path.
As mentioned I tried the following: "_BICOCLASSES ICON %ProjectPath%BCLASSES.ICO" - this didn't work. I changed the Project Properties to relative Addressing, but I saw nothing changed.

Horst
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

File not found bclasses.ico

Post by Chris »

Hi Horst,

This source (.rc files) is passed directly to the resource compiler (rc.exe), so it is not possible to use the %% macros in there, instead you need to use a path relative to the Resources folder of your app (this is where all the .rc files of the app get collected and compiled all together - a rc.exe limitation).

In which folder is the .ico file actually located in your disk?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
JohnBonnett88
Posts: 45
Joined: Mon Mar 07, 2022 12:34 am

File not found bclasses.ico

Post by JohnBonnett88 »

Hi Chris,

I have this same problem. I had a line like this in a .rc file
BICOCLASSES Icon C:UsersXVJBONNEsourcereposLabProIconsbClasses.ico

And tried changing to a relative path to work for any user
BICOCLASSES Icon ....IconsbClasses.ico

I got an error
error RC2142: ellipsis requires three periods

And tried
BICOCLASSES Icon ......IconsbClasses.ico

And got the same error. I am currently assuming the resource compiler is running where the resource file is.

Is there documentation for the resource compiler?

Keep up the good work,
John
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

File not found bclasses.ico

Post by Chris »

Hi John,

You can try from the command prompt rc.ece /? to see some info, but this tool (from MS) is very badly documented and extremely fragile unfortunately.
In your case, I think the problem is the backslashes, the texts are treated as c-like strings, so you need to double the slashes, as in:

BICOCLASSES Icon C:UsersXVJBONNEsourcereposLabProIconsbClasses.ico

Also the relative path version should work the same way.

In case it doesn't, can you please and make sure that the format of the .rc file is ANSI? If it's UTF/Unicode etc, then it is very common for unexplainable errors like those to appear.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
JohnBonnett88
Posts: 45
Joined: Mon Mar 07, 2022 12:34 am

File not found bclasses.ico

Post by JohnBonnett88 »

Thanks Chris,

With your help, I have made some progress. I changed the code to
BICOCLASSES Icon ......IconsbClasses.ico

It seems to want the 3 dots, and now I get this error
error RC2135: file not found: ......IconsbClasses.ico

Now that could mean that path is nonsense, or perhaps it is recognizing it as a proper relative path, but it is not the right one.

When rc.exe is running, what folder is it in?

Thanks again,
John
JohnBonnett88
Posts: 45
Joined: Mon Mar 07, 2022 12:34 am

File not found bclasses.ico

Post by JohnBonnett88 »

Hi Chris,

I have resolved my problem, so here is some feedback in case it helps someone else.

I found some documentation of the resource compiler here https://docs.microsoft.com/en-us/window ... e-compiler

The documentation of the Icon statement said the file name should be a quoted string, even though their examples on the same page showed them without quotes. When you do use quotes, you don't need to double the backslashes or use "...".

I also had a mistake of my own, the relative path was wrong! It looks like the resource compiler runs in the folder where the *.rc file is, so the code that worked in my case was:
BICOCLASSES Icon "..IconsbClasses.ico"

Thanks again for your help,
John
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

File not found bclasses.ico

Post by Chris »

Hi John,

Glad you have it working and thanks for the detailed info!

.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

File not found bclasses.ico

Post by robert »

John,
Try to use single backslashes and put double quotes around the filename.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply