473,383 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Sharing Resource Files Between C# and C++, Possible?

I have a Managed C++ DLL used by a C# application. I'm building with VS .NET
2002.

I have a resx file loaded with string data. The C# application can access
the string data fine, like so:

ResourceManager rm = new ResourceManager("DS.Names",
Assembly.GetExecutingAssembly());
String text = rm.GetString("1");

Now in my Managed C++ DLL I want to do the same thing:

ResourceManager* rm = new ResourceManager("DS.Names",
Assembly::GetExecutingAssembly());
System::String* text = rm->GetString("1");

However, while it compiles fine if fails with this error on the GetString
line:

'System.Resources.MissingManifestResourceException ' occurred in
mscorlib.dll.

Clearly the C++ DLL cannot locate the resource.

Is it possible to share this resx file between C# and C++? If so, how?

Thanks.
Nov 17 '05 #1
2 6515
Ok, I think I've determined that resx files are not supported on .NET 2002
and C++.

Maybe .NET 2003 and Framework 1.1 supports this.

Can anyone confirm this?

Thanks.

"Dave L" <en*********@yahoo.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
I have a Managed C++ DLL used by a C# application. I'm building with VS ..NET 2002.

I have a resx file loaded with string data. The C# application can access
the string data fine, like so:

ResourceManager rm = new ResourceManager("DS.Names",
Assembly.GetExecutingAssembly());
String text = rm.GetString("1");

Now in my Managed C++ DLL I want to do the same thing:

ResourceManager* rm = new ResourceManager("DS.Names",
Assembly::GetExecutingAssembly());
System::String* text = rm->GetString("1");

However, while it compiles fine if fails with this error on the GetString
line:

'System.Resources.MissingManifestResourceException ' occurred in
mscorlib.dll.

Clearly the C++ DLL cannot locate the resource.

Is it possible to share this resx file between C# and C++? If so, how?

Thanks.

Nov 17 '05 #2
I found a work around.

Use the Resource File Generator (resgen.exe) and convert from a resx to a
resources file. Then ResourceReader can be used by C++ to read the data as
opposed to ResXResourceReader.

This can be automated in the build process.
"Dave L" <en*********@yahoo.com> wrote in message
news:u3**************@TK2MSFTNGP11.phx.gbl...
Ok, I think I've determined that resx files are not supported on .NET 2002
and C++.

Maybe .NET 2003 and Framework 1.1 supports this.

Can anyone confirm this?

Thanks.

"Dave L" <en*********@yahoo.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
I have a Managed C++ DLL used by a C# application. I'm building with VS

.NET
2002.

I have a resx file loaded with string data. The C# application can access the string data fine, like so:

ResourceManager rm = new ResourceManager("DS.Names",
Assembly.GetExecutingAssembly());
String text = rm.GetString("1");

Now in my Managed C++ DLL I want to do the same thing:

ResourceManager* rm = new ResourceManager("DS.Names",
Assembly::GetExecutingAssembly());
System::String* text = rm->GetString("1");

However, while it compiles fine if fails with this error on the GetString line:

'System.Resources.MissingManifestResourceException ' occurred in
mscorlib.dll.

Clearly the C++ DLL cannot locate the resource.

Is it possible to share this resx file between C# and C++? If so, how?

Thanks.


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kyle Kaitan | last post by:
I have an assembly (AppResources.dll) which contains a number of embedded resource files. Most of these are key/value pairs of relevant strings; a few are images and sounds; some more are XML...
0
by: Dave L | last post by:
I have a Managed C++ DLL used by a C# application. I'm building with VS .NET 2002. I have a resx file loaded with string data. The C# application can access the string data fine, like so: ...
6
by: Thomas Andersson | last post by:
Hi all, I've been thinking of about adding new languages to our website and is currently investigating how this could be done. And I know that one way to go would be to create new aspx-pages...
3
by: Jules | last post by:
i'm working with translators that just want to translate "web pages" and not deal with resource files. i'd like to have a file structure that looks sort of like this: / <- root directory where...
3
by: M Schnell | last post by:
All, I've run into a problem and I'm hoping someone here can help me. I've got a ASP.NET solution with six projects within. The main web project has several resource files (.resx) to support...
0
by: Martin Gregersen | last post by:
Hi Can anybody tell me if it is possible to share Resource files between an ASP.NET and a Windows(WinForms) project? And if so, how :o) The situation: A colleague and I is working on two...
7
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of...
19
by: Zytan | last post by:
I want multiple instances of the same .exe to run and share the same data. I know they all can access the same file at the same time, no problem, but I'd like to have this data in RAM, which they...
0
by: VigneshS | last post by:
Hi, I am a newbie to Globalization and Localisation Concepts. I tried almost all the methods of the Globalization concepts. But i cannot be able to embed a text file within a Resource. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.