473,394 Members | 1,706 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,394 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 6516
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.