473,386 Members | 1,812 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,386 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

Jul 21 '05 #1
3 1703
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
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
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 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...
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...
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
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...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...

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.