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 / Languages / Managed C++ / May 2004

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave L - 04 May 2004 21:37 GMT
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.
Dave L - 04 May 2004 23:56 GMT
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.

> I have a Managed C++ DLL used by a C# application. I'm building with VS .NET
> 2002.
[quoted text clipped - 23 lines]
>
> Thanks.
Dave L - 05 May 2004 00:28 GMT
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.

> Ok, I think I've determined that resx files are not supported on .NET 2002
> and C++.
[quoted text clipped - 33 lines]
> >
> > Thanks.

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.