Author Topic: any tricks to making menu image dll's with vs2008?  (Read 4337 times)

0 Members and 1 Guest are viewing this topic.

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
any tricks to making menu image dll's with vs2008?
« on: September 29, 2008, 11:29:06 AM »
I used to use vb6 but want to use .net now.
I converted my old vb6 project, made the dll, but it does not work, the toolbars do not show the images.
Can anyone point me to instructions on this?
I have a feeling it has to do with the names, but there is no rc file involved in the .net project...
thx
James Maeding

M-dub

  • Guest
Re: any tricks to making menu image dll's with vs2008?
« Reply #1 on: September 29, 2008, 11:35:18 AM »
Can't help you much with .net but I've had good experiences with Resource Hacker in the past.  If you search the forum for reshack, reshacker, etc. you'll find some solutions.


/FWIW

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: any tricks to making menu image dll's with vs2008?
« Reply #2 on: September 29, 2008, 12:12:13 PM »
I used to use a tool named "ResourceTool.exe", and can still, but it only makes the .res file.
thx though
James Maeding

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: any tricks to making menu image dll's with vs2008?
« Reply #3 on: September 29, 2008, 12:16:01 PM »
Stupid question... The DLL and menu file have the same name, correct?
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: any tricks to making menu image dll's with vs2008?
« Reply #4 on: September 29, 2008, 12:19:27 PM »
I have a similar problem. I have a.dll that I created using Resource Hacker and it has worked flawless unlit 07 Now I have no toolbar images??
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: any tricks to making menu image dll's with vs2008?
« Reply #5 on: September 29, 2008, 12:25:29 PM »
yes, I had to edit the assembly name in VS, as the default from the conversion was not right.
I did notice the conversion added "bmp" to the front of the name so I deleted all items and added back myself, this time with same name as file.
I also set access modifier to public, not sure if that matters.
James Maeding

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: any tricks to making menu image dll's with vs2008?
« Reply #6 on: September 29, 2008, 12:41:35 PM »
hey, the resource hacker prog worked well.
I found instructions at:
http://www.afralisp.net/vbaa/vbadll.htm

Only issue is you have to add items one by one.
Sometimes I want to do a whole folder of bitmaps.
oh well, I'm rolling again.
James Maeding

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: any tricks to making menu image dll's with vs2008?
« Reply #7 on: September 29, 2008, 01:19:11 PM »
I use VS2003 and I have to add the images one at a time.  They also have to be all caps
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: any tricks to making menu image dll's with vs2008?
« Reply #8 on: September 29, 2008, 02:13:52 PM »
just noticed you can tell a c# project to use a .res file for resources, look under Application tab of project properties.
Also, Resource Hacker lets you update based on an .res file.
So that is two solutions that rely on the ResourceTool.exe, by Ed Jobe © 2003 (attached)

Anyway, that ResourceTool.exe is not working now! figures.
I'm not sure why but I get errors about file path not found, I do remember its picky.

When it is working, the steps to my process are:

1) get ResourceTool.exe by Ed Jobe © 2003, attached
2) make text file with extension .rc, that has one line per bitmap, in format:
<Name specified in menu><tab>Bitmap<tab><filename>

example lines:
01_Audit   Bitmap   01_Audit.bmp
01_BMgr   Bitmap   01_BMgr.bmp
01_DwgInfo   Bitmap   01_DwgInfo.bmp
01_fnext   Bitmap   01_fnext.bmp
01_fprev   Bitmap   01_fprev.bmp

The prog will do it for you if you set the source folder, then say "Create RC file".

3) run the "Create .res file" button
4) open an existing dll with resource hacker and update the items using the res file, its an option.
You can also make a blank dll project with VS and tell it to use the res file for resources in the project properties, Application page.

I sure wish I knew how to make it work without the .res file though, I don't like two step process that involve utils I cannot even figure out where to download....
James Maeding

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: any tricks to making menu image dll's with vs2008?
« Reply #9 on: September 29, 2008, 02:34:25 PM »
ok, did some more looking, and the resourcetool.exe is not so important.
That tool must run the microsoft Resource Compiler, which is rc.exe, and simply takes the rc file as a param.
So I made a batch file to run it, its one line:

"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\RC.Exe" "C:\test\myrcfile.rc"

it makes the res file for you, so that is pretty easy, and allows easy multiple file handling.
End process is:
1) make .rc file
2) run batch file to make res file
3) recompile VS project to get new dll.

not bad at all, essentially same steps as with vb6.
James Maeding

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: any tricks to making menu image dll's with vs2008?
« Reply #10 on: September 29, 2008, 03:45:42 PM »
while on the subject, I recommend placing this kind of function in all mnl files:
(defun c:CTmnu ()
  (command ".menuunload" "CT-CIVIL")
  (command ".menuload" "CT-CIVIL.mnu")
  (princ)
)

That unloads and reloads the mnu file.
I still use mnu files for customized menus, not CUI.

I guess if you use CUI files, you would say:
(command ".menuload" "CT-CIVIL.cui")
instead...
Super handy.
James Maeding