Gaston Milano's WebLog

About something...

News

General

Usability

VS Automation

VSIP

VSIP Sample: Resource Editor for VS.Net

As we all know, working with image resources in .NET is hard. In this particular case, when I have a .resx file in my project I find it difficult to update images, add new icons and so on because the editor associated to .resx files is XML-based. So for example when I download a project from the Web and the project has a .resx file I can't edit images easily.

Microsoft SDK v.1.1 includes a sample application called ResEditor (<program files>\Microsoft Visual Studio .NET 2003\SDK\v1.1\Samples\Tutorials\resourcesandlocalization\reseditor) for editing resource files, but it has some problems:

1) The main method doesn't receive parameters; therefore you cannot set it as your default editor for .resx files.

2) The dirty flag for the document is not working well. Before closing, the program always prompts to save even if you haven’t modified the document.

3) You can't edit individual items such as icons or bitmaps.

So I developed a resource editor for .resx integrated to Visual Studio using VSIPExtras and the ResEditor sample as base code. Basically, the ResEditor was built using the VSIPExtras wizard for a new package, and after that I built the editor with the refactored ResEditor sample.

Features:

- Dirty flag management

- You can edit and save an icon or bitmap with Visual Studio editor and it is updated in the resx editor!!

- If the bitmap has more than 256 colors it is edited with mspaint.

- You can edit ImageLists

Some screenshots:

 

Installation (Visual Studio 2003 required):

- Extract the downloaded files to a folder. (i.e.: C:\ResEditor)

- If you copy the files to a folder other than C:\ResEditor, edit regEditor.reg and replace C:\\ResEditor with you path. (Use "\\" insted of "\" i.e "c:\\Program Files\\MyPath" )

- Run regEditor.reg

- Open Visual Studio 2003 command prompts and type "devenv /setup"

Test:

- Open Visual Studio 2003.

- In the Open File dialog select a resx file and select Open With. (Dropdown in the Open button)

- Select the ResEditorEx as your resource editor (if you want set it as your default :)

I have updated this post because the links were broken. You can download the new bits and code here  

http://weblogs.asp.net/gmilano/archive/2004/04/21/117438.aspx

Note:

-         This editor depends on the primary interop assemblies of VSIPExtras. VSIPExtras is not released yet so the primary interop assemblies may change in the next beta or release version.

Improvements to the code are welcome. For instance, I’d like to enhance the editor with undo&redo support, support for edit new types, ...

Comments

Scott Willeke said:

What would it take to make these managed packages work in VS2002? Is there plans in the final release of VSIPExtras to make them work with VS2002?
# March 3, 2004 10:19 PM

GMilano said:

From the microsoft newsgroup (microsoft.beta.vsip.extras)

"The VSIPEx add-on is only for 2003. Actually, I don't think many people can
even get the VSIP SDK for VS 2002 anymore. You must be one of the few :-)" Ed Dore [MSFT]





# March 4, 2004 7:42 AM

Scott Willeke said:

Thanks :)
# March 4, 2004 11:44 AM

Stephan Huber said:

Hi
Nice tool, exactly the one I was looking for. But I got a problem.
After editing any bitmap and closing the file, the resource file gets an error, and the corresponding image is lost. The error message is "Arguement Exception: Invalid Parameter used"
Can you help me
# March 10, 2004 3:28 AM

GMilano said:

I fixed the problems try to download again please.

Really working with bitmaps is not as easy as I thought, then I had a couple of locking problems. In general all resource editor have problems with bitmaps. Basically when you insert an image from a file the file is locked then in this case it is unlocked only when you close the Visual Studio.
I'm going to post something about the problems I found working with bitmaps.

Regards,
Gaston Milano
# March 10, 2004 3:46 PM

TrackBack said:

test
# March 27, 2004 6:06 PM

Jhon Silva said:

Installed the editor following the steps discribed but when I call the "open with" option I get the following error message:

"Package 'ResEditor' as failed to load properly ( GUID = {4e57d8e4-faa3-4997-971d-3dba0005efed} ). Please contact package vendor for (...)"
Any ideia about what may be causing this?

Thanks in advance
# March 29, 2004 10:14 AM

GMilano said:

VS is failing to load the package key from the resources, probably the satellite dll path is wrong.
Check if you have this key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Packages\{4e57d8e4-faa3-4997-971d-3dba0005efed}\SatelliteDll

and if you have check the value of "Path" inside this key, you should have the installation path.


# March 29, 2004 11:11 AM

TrackBack said:

# March 30, 2004 4:00 PM

TrackBack said:

# March 31, 2004 6:56 AM

Jhon Silva said:

solution found! The SatelliteDll's path was ok but the InprocServer32 path was pointing the a path that doesn't exist (my windows folder is not located in drive c:\ and it has the name Winnt)
Thanks for the help!

PS: Would be nice an "export" button that allowed saving resources back to disk :)
# April 1, 2004 4:52 AM

GMilano said:

Sorry I don't understand the "export" that you want, actually you can modify the file and save back to disk. In the icon, bitmap and string tabs you have an edit button, after edit the file your Editing Resx Files turn dirty and you can save it with Ctrl + S or File/Save
# April 1, 2004 7:14 AM

TrackBack said:

# April 1, 2004 7:14 AM

Jhon Silva said:

You're right, but it would be handy if we could save a resource to disk in it's original format.
For example, one could open a .resx file and save each contained bitmap to disk as .bmp files.
# April 1, 2004 8:28 AM

GMilano said:

It's a cool feature, it will be included in the next release :)
Thanks for your feedback.
# April 1, 2004 10:43 AM

Problems w/ Bitmaps disappearing said:

I have had a problem with bitmaps disappearing when I close and re-open the project. If I add a bitmap to the resources of a form and run, the bitmap is there. But it seems that if I close and re-open the project, the bitmap disappears from the form's resources.

I download the CodeProject version. ResEditor.dll version is 1.0.1550.18974.
# April 7, 2004 10:29 AM

GMilano said:

I was trying to reproduce this problem and I couldn't...
# April 7, 2004 10:59 AM

scdsun said:

Thank you very much.
I like it.
# April 9, 2004 2:28 AM

scdsun said:

Please give me a notice while there is a new vension.
zhuyj441@sohu.com
# April 9, 2004 2:35 AM

TrackBack said:

# April 13, 2004 3:30 PM

TrackBack said:

# April 21, 2004 8:47 AM

TrackBack said:

# May 14, 2004 11:10 AM

Aaron Prenot said:

Hi. I have been trying to use this program for over an hour, and I can't figure it out. I use the Open With... screen an select Resource Editor, and it always comes back "Cannot load any resources from this file". I tried to open the source file and the resource file, but I keep getting nothing. What am I doing wrong?
# May 16, 2004 1:00 AM

GMilano said:

You have to select ResEditorEx and not Resource Editor

Regards,
Gaston
# May 16, 2004 7:26 PM

kilroy said:

Nice work.

Unless I'm missing something, can I re-name a resource?
# May 23, 2004 3:10 AM

GMilano said:

Thanks,
No you can´t, I´ll update this sample with this feature ASAP
# May 23, 2004 9:55 AM

HBloggins said:

Your resource editor is fabulous. I've been using it with great success until I loaded Together. It causes VS to politely yet completely ignore the editor. The uninstall-reinstall dance made no difference: The editor just won't load. sigh...
# June 4, 2004 7:32 PM

dianyingxiazai said:

href=//www.dmoz.net.cn/ wangzhidaquang
href=//www.86dmoz.com/ jingpingwangzhi
href=//www.kamun.com/ mianfeidianying
href=//www.kamun.com/ dianyingxiazai
href=//www.kamun.com/ MP3 free download
href=//www.pc530.net/ diannaoaihaozhe
href=//www.5icc.com/ duangxingcaixingxiazha
href=//www.dianyingxiazai.com/ dianyingxiazai
href=//www.yinyuexiazai.com/ yinyuexiazai
# August 2, 2004 2:35 AM

counterstr said:

<a href= http://index6.lookkhim.com >girls wild</a> <a href= http://index5.lookkhim.com >push button switches</a> <a href= http://index2.lookkhim.com >movies kissimmee fl</a> <a href= http://index1.lookkhim.com >1985 gti pics</a> <a href= http://index3.lookkhim.com >atkgallery</a> <a href= http://index4.lookkhim.com >summerolympics</a> <a href= http://index9.lookkhim.com >is tweety bird a boy or a girl</a> <a href= http://index10.lookkhim.com >rate my cock</a> <a href= http://index8.lookkhim.com >calcium carbonicum</a> <a href= http://index7.lookkhim.com >spider glue strips</a>

# April 26, 2008 7:09 AM

counterstr said:

<a href= http://index6.lookkhim.com >girls wild</a> <a href= http://index5.lookkhim.com >push button switches</a> <a href= http://index2.lookkhim.com >movies kissimmee fl</a> <a href= http://index1.lookkhim.com >1985 gti pics</a> <a href= http://index3.lookkhim.com >atkgallery</a> <a href= http://index4.lookkhim.com >summerolympics</a> <a href= http://index9.lookkhim.com >is tweety bird a boy or a girl</a> <a href= http://index10.lookkhim.com >rate my cock</a> <a href= http://index8.lookkhim.com >calcium carbonicum</a> <a href= http://index7.lookkhim.com >spider glue strips</a>

# April 26, 2008 7:09 AM

counterstr said:

<a href= http://index6.lookkhim.com >girls wild</a> <a href= http://index5.lookkhim.com >push button switches</a> <a href= http://index2.lookkhim.com >movies kissimmee fl</a> <a href= http://index1.lookkhim.com >1985 gti pics</a> <a href= http://index3.lookkhim.com >atkgallery</a> <a href= http://index4.lookkhim.com >summerolympics</a> <a href= http://index9.lookkhim.com >is tweety bird a boy or a girl</a> <a href= http://index10.lookkhim.com >rate my cock</a> <a href= http://index8.lookkhim.com >calcium carbonicum</a> <a href= http://index7.lookkhim.com >spider glue strips</a>

# April 26, 2008 7:09 AM

Semil said:

<a href= spiritez.com ></a>

# December 5, 2008 9:47 PM

Olgunka-pa said:

<a href= membres.lycos.fr/maffals >genetic disorters</a>

# December 26, 2008 10:56 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)