明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5025|回复: 25

[求助]我的程序有很多BMP﹐怎樣把它們做成DLL或其它格式﹖

  [复制链接]
发表于 2005-6-6 20:59:00 | 显示全部楼层 |阅读模式
[求助]我的程序有很多BMP﹐怎样把它们做成DLL或其它格式﹖最终只能是一个文件。


做好后﹐相应的菜单文件须做怎样的变更﹖





谢谢大伙了﹗
"觉得好,就打赏"
还没有人打赏,支持一下
 楼主| 发表于 2005-6-7 21:26:00 | 显示全部楼层
大侠们这几天是不是都喝酒去了!
发表于 2005-6-7 22:27:00 | 显示全部楼层
可以用ResHacker.exe将bmp文件防到dll文件中,dll文件名必须和调用其的菜单组名同名
 楼主| 发表于 2005-6-8 20:23:00 | 显示全部楼层
请cqnj023大侠详细讲解下,我下载了Resource Hacker,但不知道怎么用!怎么来达到我的目的?
发表于 2005-6-8 20:34:00 | 显示全部楼层

回复

在Resource Hacker中可以添加bmp,并指定ID 然后将dll文件放在AutoCAD搜索路径下,相应的mnu文件使用此dll如下(主要是使用bmp的ID): 注意: mymnu.mnu和mymnu.dll要同文件名. ...
***MENUGROUP=DEVCAD //
// Begin AutoCAD Pull-down Menus
// //
// 自定义菜单MENU
// //
// 自定义工具条
// ***TOOLBARS **TB_TOOLBAR1
ID_TOOLBAR1 [_Toolbar("Toolbar1", _Floating, _Show, 500, 100, 1)]
ID_ToolPaletteOn [_Button("打开工具选项板", ID_TPON, ID_TPON)]^C^C_PALETTEON
ID_ToolPaletteOff [_Button("关闭工具选项板", ID_TPOFF, ID_TPOFF)]^C^C_PALETTEOFF
[--]
ID_DJMAP [_Button("拼接程序导入的16幅1:500图",ID_DJMAP, ID_DJMAP)]^C^C_DJMAP
ID_PJMAP [_Button("拼接打开的16幅1:500图",ID_PJMAP, ID_PJMAP)]^C^C_PJMAP
[--]
ID_VERIFY [_Button("检查1:500图接边数据",ID_VERIFY, ID_VERIFY)]^C^C_VERIFY
[--]
ID_ROADTEXT [_Button("标注道路注记", ID_ROADTEXT, ID_ROADTEXT)]^C^C^P(vl-vbarun "InsertText")
ID_UNITTEXT [_Button("适当选取单位注记点", ID_UNITTEXT, ID_UNITTEXT)]^C^C^P(vl-vbarun "ProcessText")
[--]
ID_PIPELINE [_Button("处理管线数据", ID_PIPELINE, ID_PIPELINE)]^C^C^P(vl-vbarun "ZhQsMain")
ID_GK&DLDW [_Button("处理工矿独立地物数据", ID_GK&DLDW, ID_GK&DLDW)]^C^C^P(vl-vbarun "QsMain")

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
 楼主| 发表于 2005-6-8 21:21:00 | 显示全部楼层
是不是要一个一个BMP去添加﹖我试著添加了一个﹐但是保存时没有提示是DLL﹐面是什么.rc,我有点晕了﹖
发表于 2005-6-8 22:07:00 | 显示全部楼层
好帖!又学了一招。
发表于 2005-6-9 12:02:00 | 显示全部楼层
看看下面的文章吧!一个一个往里加,岂不累死人! Commandline Scripting: All the functionality of the Resource Hacker?GUI (apart from viewing resources) can be accessed from the commandline without having to open Resource Hacker? Commandline scripting can remove the drudgery entailed with repetitive Resource Hacker?tasks. Commandline scripts have 2 general forms: 1. Single commands:
ResHacker.exe command command_parameters
2. Multiple commands:
ResHacker.exe -script scriptfile Single Commands: command and command_parameters:
-add ExeFile, SaveAsFile, ResourceFile, ResourceMask
-addskip ExeFile, SaveAsFile, ResourceFile, ResourceMask
-addoverwrite ExeFile, SaveAsFile, ResourceFile, ResourceMask
-modify ExeFile, SaveAsFile, ResourceFile, ResourceMask
-extract ExeFile, ResourceFile, ResourceMask
-delete ExeFile, SaveAsFile, ResourceMask Each command parameter must be separated by a comma, but no comma is expected before the first parameter. If paths are not included with filenames, then the operating systems?current folder is presumed to contain the named file. It is generally good practise, though not required here, to enclose filenames contain spaces within double quotes. The ResourceMask enables a command to be performed on either single or multiple resource items and takes the form ResType,ResName,ResLang. If ResType is a predefined type, then either its number or identifier can be used - eg the ResourceMask dialog,128,0 is identical to 5,128,0. Any or all of the ResourceMask items can be omitted - eg dialog,, indicates that all dialogs are to be applied to the command irrespective of name or language, and ,,1049
indicates that all resources with Russian (1049) as the languageID will be applied to the command. An empty ResourceMask ,, indicates that the command will be applied to every resource irrespective of type, name or language. When adding or modifying items, the ResourceFile can be a RES file for any item type, a BMP file for BITMAP types, a CUR file for CURSORGROUP types, an ICO file for ICONGROUP types, and any file type for RCDATA and user defined resource types. When adding and modifying resources from files other than RES files then both ResType and ResName must be specified in the ResourceMask. (If ResLang is omitted then the command applies to the first language item with matching type and name, otherwise, if no matching item exists then language neutral (0) is assumed.) When extracting resources, and more than one item is implied by the ResourceMask, then the specified ResourceFile must be either a RES file or an RC file. When binary image resources are extracted to RC files, each image is also created as a separate binary (ico, cur, bmp, gif, bin) file. See example below. ICON and CURSOR resources cannot be manipulated directly but are added, deleted, modified, and extracted by using their respective ICONGROUP or CURSORGROUP. ICON and CURSOR can still be used but Resource Hacker?will assume ICONGROUP or CURSORGROUP was intended. Borland抯 DFM files can also be added irrespective of whether the file is in binary or text format. However, they will always be extracted in text format. (To convert text formatted dfm files to binary format, use Borland抯 utility Convert.exe.) All actions or errors are logged to 揜esHacker.log? NB: If a script does not produced the desired results then check the log! Examples: (File paths have been omitted to aid clarity)
To add or update dialog name:maindlg lang:0 in MyProg.exe from UpdDlg.res
ResHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, upddlg.res, dialog,maindlg,0 To add or update bitmap name:128 in MyProg.exe from NewImage.bmp
ResHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, NewImage.bmp , bitmap,128, To add or update all bitmaps in MyProg.exe from Images.res
ResHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, Images.res, bitmap,, To add a 摇serdefined?binary resource (README,1,0) to MyProg.exe from ReadMe.html
ResHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, ReadMe.html, readme,1,0 To add all items in Images.res to MyProg.exe (but fail if any item already exists)
ResHacker.exe -add MyProg.exe, MyProgNew.exe, Images.res ,,, To add all items in Images.res to MyProg.exe (skipping any existing items)
ResHacker.exe -addskip MyProg.exe, MyProgNew.exe, Images.res ,,, To modify all items in MyProg.exe with the items in Images.res (ignoring any items in Images.res which do not exist in MyProg.exe)
ResHacker.exe -modify MyProg.exe, MyProgNew.exe, Images.res , , , To extract all icons from MyProg.exe to myprogicons.rc (creating myprogicons.rc, Icon_1.ico, Icon_2.ico , Icon_3.ico etc...)
ResHacker.exe -extract MyProg.exe, myprogicons.rc, icongroup,, To delete GIF name:128 from MyProg.exe
ResHacker.exe -delete MyProg.exe, MyProgNew.exe, gif,128, Multiple Commands: syntax: ResHacker.exe -script ScriptFile
ScriptFile is a text file with the following layout: //comments are preceeded by double slashes
[FILENAMES]
Exe=
SaveAs=
Log= [COMMANDS]
-add ResourceSrc, ResourceMask
-addskip ResourceSrc, ResourceMask
-addoverwrite ResourceSrc, ResourceMask
-addoverwrite ResourceSrc, ResourceMask
-modify ResourceSrc, ResourceMask -extract ResourceTgt, ResourceMask
-delete ResourceMask If Log is omitted then the default log - ResHacker.log - will be used.
NB: If a script does not produced the desired results then check the log! Examples: rh_script_myprog_rus.txt - //This script deletes all Language Neutral(0)
//stringtable, menu and dialog resource items
//in MyProg.exe before replacing them
//with Russian(1049) items... [FILENAMES]
Exe= MyProg.exe
SaveAs= MyProg_Rus.exe
Log= MyProg_Rus.log [COMMANDS]
-delete MENU,,0
-delete DIALOG,,0
-delete STRINGTABLE,,0
-add MyProg_Rus.res, MENU,,1049
-add MyProg_Rus.res, DIALOG,,1049
-add MyProg_Rus.res, STRINGTABLE,,1049
rh_script_myprog_upd_images.txt - //This script updates 2 bitmaps and an
//icon in MyProg.exe ... [FILENAMES]
Exe= MyProg.exe SaveAs= MyProg_Updated.exe [COMMANDS]
-addoverwrite Bitmap128.bmp, BITMAP,128,
-addoverwrite Bitmap129.bmp, BITMAP,129,0
-addoverwrite MainIcon.ico, ICONGROUP,MAINICON,0
rh_script_myprog_upd_all.txt - //This script replaces all resources
//in MyProg.exe with all the resources
//in MyProgNew.res [FILENAMES]
Exe= MyProg.exe
SaveAs= MyProg_Updated.exe [COMMANDS]
-delete ,,, //delete all resources before... -add MyProgNew.res ,,, //adding all the new resources
 楼主| 发表于 2005-6-9 19:46:00 | 显示全部楼层
谢谢GU_XL大侠!


E文读起来有点困难,得找个高人翻译下.
发表于 2005-6-9 22:33:00 | 显示全部楼层
其实不做成dll也行,直接将位图放在搜索路径下就行了.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-26 06:06 , Processed in 0.166429 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表