By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,883 Members | 2,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,883 IT Pros & Developers. It's quick & easy.

Win32 Resources in .NET Question

P: n/a
I'm trying to retrieve a string resource from a Win32 file.

In win32 world I would just use LoadLibrary and LoadString.

What do I use in the .NET world?

--
Chris Burr
cb***@kcc.com

Jul 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Christopher,

If you are working with the new resource model in .NET, then you will
want to take a look at the classes in the System.Resources namespace
(specifically ResourceManager for culture-specific resources). Also, you
can include resources directly into your app that are not culture specific.
You just have to add the file to your project, and set the Build Action
property of the file to "Embedded Resource". If you do that, you can then
call GetManifestResourceStream on the Assembly that represents your
assembly, passing in the project name, and then the name of the file. If
your project was named "Project1", and the file was named "MyFile1.txt",
then you would pass "Project1.MyFile1.txt" to GetManifestResourceStream.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Christopher Burr" <cb***@kcc.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I'm trying to retrieve a string resource from a Win32 file.

In win32 world I would just use LoadLibrary and LoadString.

What do I use in the .NET world?

--
Chris Burr
cb***@kcc.com

Jul 21 '05 #2

P: n/a
No what I'm trying to do is grab resource ID 1 out of the file ss3dfo.scr,
which is a win32 file. Need to know how to read the PE resources in .NET

--
Chris Burr
cb***@kcc.com
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:um**************@TK2MSFTNGP09.phx.gbl...
Christopher,

If you are working with the new resource model in .NET, then you will
want to take a look at the classes in the System.Resources namespace
(specifically ResourceManager for culture-specific resources). Also, you
can include resources directly into your app that are not culture specific. You just have to add the file to your project, and set the Build Action
property of the file to "Embedded Resource". If you do that, you can then
call GetManifestResourceStream on the Assembly that represents your
assembly, passing in the project name, and then the name of the file. If
your project was named "Project1", and the file was named "MyFile1.txt",
then you would pass "Project1.MyFile1.txt" to GetManifestResourceStream.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Christopher Burr" <cb***@kcc.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I'm trying to retrieve a string resource from a Win32 file.

In win32 world I would just use LoadLibrary and LoadString.

What do I use in the .NET world?

--
Chris Burr
cb***@kcc.com


Jul 21 '05 #3

P: n/a
Christopher,

In this case, you will want to call the same API functions you would in
an unmanaged application, as I don't believe there is support in the
framework for them.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Christopher Burr" <cb***@kcc.com> wrote in message
news:uE****************@TK2MSFTNGP12.phx.gbl...
No what I'm trying to do is grab resource ID 1 out of the file ss3dfo.scr,
which is a win32 file. Need to know how to read the PE resources in .NET

--
Chris Burr
cb***@kcc.com
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:um**************@TK2MSFTNGP09.phx.gbl...
Christopher,

If you are working with the new resource model in .NET, then you will want to take a look at the classes in the System.Resources namespace
(specifically ResourceManager for culture-specific resources). Also, you can include resources directly into your app that are not culture

specific.
You just have to add the file to your project, and set the Build Action
property of the file to "Embedded Resource". If you do that, you can then call GetManifestResourceStream on the Assembly that represents your
assembly, passing in the project name, and then the name of the file. If your project was named "Project1", and the file was named "MyFile1.txt",
then you would pass "Project1.MyFile1.txt" to GetManifestResourceStream.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Christopher Burr" <cb***@kcc.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I'm trying to retrieve a string resource from a Win32 file.

In win32 world I would just use LoadLibrary and LoadString.

What do I use in the .NET world?

--
Chris Burr
cb***@kcc.com



Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.