Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / September 2005

Tip: Looking for answers? Try searching our database.

Problems inserting resource files into unmanaged C++ project in VS.NET 2003 IDE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Oenone - 13 Sep 2005 14:36 GMT
Working on my first C++ project (unmanaged) in the VS.NET 2003 IDE (I've
been using VC++6 up until this point), I've been struggling for a couple of
days to simply embed a file as a resource into my executable.

I started off by trying to add a .jpg file. I selected Project/Add Resource
from the main menu, clicked Import and then selected the .jpg I want to add.
VS.NET 2003 opens a dialog box with a big red X icon, displaying the message
"No error occurred" (with just an OK button). However, I find that the JPG
has not been added to the project, and instead I have a resource of type
Bitmap with the ID IDB_BITMAP1. Double-clicking it displays an empty 48x48
pixel graphic, not the JPG I selected. Any ideas?

After deleting the BMP resource, I tried to add two other resources: a .tga
file containing a font and a .dat file containing metrics about the
characters within the font.

I imported the .tga file (using the same procedure as above), creating a new
resource type of TGA, and this worked and compiled fine. Then I imported the
.dat file, creating another new resource type of DAT. Upon compiling, I now
get the following error message:

   error RC2135 : file not found: "RESOURCES\\FONTWIDTHS.DAT"

I've tried manually compiling the .rc file using the rc.exe utility and I
get the same error. I've also tried changing the double-backslash to a
single-backslash just in case, but it didn't make any difference. The
specified file definitely exists.

I also find that once I have added a resource file (the .tga file, for
example), the IDE takes AGES to open the project (in excess of a minute).
All the time it's doing this it just displays an empty window, with just the
tabs of the open source files at the top. Deleting the .sou file from the
project directory gets the project opening quickly again, but then I find
that the first source file I open (main.cpp for example) causes the huge
delay.

Can anyone help me out with any of this? I'm getting very close to dumping
the VS.NET2003 IDE and going back to VC++6...

My thanks in advance,

Signature

(O)enone

Oenone - 18 Sep 2005 09:33 GMT
> Working on my first C++ project (unmanaged) in the VS.NET 2003 IDE
> (I've been using VC++6 up until this point), I've been struggling for
> a couple of days to simply embed a file as a resource into my
> executable.

The complete lack of response to this is leading me to the conclusion that
either:

a) no one else embeds resources in their applications in C++

or

b) no one else has any problems with embedding resources

Could some of you at least give me a hint as to which is the case?

Thanks,

Signature

(O)enone

David Lowndes - 18 Sep 2005 18:48 GMT
>I started off by trying to add a .jpg file. I selected Project/Add Resource
>from the main menu, clicked Import and then selected the .jpg I want to add.

Did VS not prompt you for a custom resource type at this stage? That's
what VS2003 (& VS2005) does for me if I import a JPG file.

>After deleting the BMP resource, I tried to add two other resources: a .tga
>file containing a font and a .dat file containing metrics about the
[quoted text clipped - 6 lines]
>
>    error RC2135 : file not found: "RESOURCES\\FONTWIDTHS.DAT"

I can't reproduce that either - but I don't have a suitable font DAT
file to try. Was the file in use maybe?

Have you tried the same things on a different PC - just wondering if
there's something odd with your VS installation?

Dave
Signature

MVP VC++ FAQ: http://www.mvps.org/vcfaq


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.