473,396 Members | 1,827 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,396 software developers and data experts.

Win32 Resources in .NET Question

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

Nov 20 '05 #1
3 1196
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

Nov 20 '05 #2
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


Nov 20 '05 #3
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



Nov 20 '05 #4

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

Similar topics

0
by: Glenn | last post by:
Hi there. Having done some Googling, it appears "win32ras" may be exactly what I'm looking for - but only if it can create connectoids/phone book entries on all desktop Win32 versions (Win9x -...
1
by: Paul Watson | last post by:
I need to access Win32 PE resources (strings, dialogs, etc.). Yes, I see that I can do it using Mark Hammond's win32all. I am using _winreg which comes with Python to access the registry. I...
0
by: Terry | last post by:
Hi all, I am helping someone to investigate a problem with a perl tool that we are using. The problem is completely random and it does not produce any errors. The tool is supposed to encrypt...
3
by: Christopher Burr | last post by:
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 cburr@kcc.com
2
by: Xeon | last post by:
Hi, Anybody could direct me to some resources on hardware programming (i.e. serial/parallel communication) on win32 platform, without using any frameworks (no MFC please)? I use MingW for...
15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
12
by: Nak | last post by:
Hi there, This might sound like a dumb question but how would I use a Win32 resource DLL in VB.NET? I presumed there were API's for this purpose but am unsure which ones, my API guide has...
0
by: Mythran | last post by:
I wrote some code that is supposed to enumerate through the specified file's win32 resources and return a string-array of all icon names. When it runs, it returns a string-array with a bunch of...
0
by: =?Utf-8?B?Q29saXZpZXI=?= | last post by:
If anyone can help me with this I would really appreciate it: I have an assembly into which I have linked a manifest file as a Win32 resource. This is necessary since I want to use a class in this...
4
Rabbit
by: Rabbit | last post by:
So I was taking a look at Stromcode's WIN32 API tutorial and he was going over window objects within a parent window. He said you have to assign a resource value to each object. Anyways, I was...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.