AlongRiver分享 http://blog.sciencenet.cn/u/yqx1985 随手的科研笔记,记录科研过程,科研生活的点点滴滴

博文

带有Activex Control(Microsoft Spreedsheet 10.0)的GUI编译问题总结

已有 5122 次阅读 2010-7-13 16:31 |个人分类:MATLAB|系统分类:科研笔记

前段时间做了个带有Microsoft Spreedsheet 10.0插件的GUI编译的时候遇到一些问题,问题解决后与大家分享一下。首先要知道的是Microsoft Spreedsheet 10.0对应的dll文件OWC10.DLL

1.执行mcc -m mymex.m后,提示错误见下:

Undefined command/function 'set_param'.
Error in==>matlabrc ai 81

解决方法:  
1
、将 MATLAB7toolboxcompilerdeploymatlabrc.m 中的81 set_param(0,'PaperType',defaultpaper)和82 set_param(0,'PaperUnits',defaultunits)注释掉,或者干脆 删掉。  
2
、在 Matlab7 命令窗口运行 rehash toolboxcache  
3
、重新编译文件后即可运行。

http://www.mathworks.com/support/solutions/data/1-22FK61.html?solution=1-22FK61

2.运行tryy.exe时提示下面的错误

Serialization of COM object failed.'Microsoft Office Spreadsheet 10.0'could not be restored to its previous state
Make sure file tryy_activex1 is in the same directory as your GUI

解决办法:
(我 的tryy.exe是由build.mtryy.m编译而成,tryy.fig中含有tryy_activex1这个控件)
tryy_activex1文件放到编译后 生成的tryy_mcr文件夹的子文件夹tryy中,即把tryy_activex1 和tryy.m,tryy.fig,build.m放在一起

3.OWC10.DLL注册时提示的错误

如果 没有注册OWC10.DLL时,会提示下面两 种错误

1.GUIDE
Unhandled internal error guidefunc.
Error using ==>uitoolsprivaterequestJavaAdapter ‘requestJavaAdapter’ argument must be a handle list
2.Error
ActiveX-control creation failed

决办法:
matlabcommand窗口下输入system 'regsvr32 OWC10.DLL' 即可
也可 以不在matlab下解决,在DOS下如此解决:
运行—cmd
cd C:Program FilesCommon FilesMicrosoft SharedWeb Components10(转到OWC.DLL所在盘符,可以 通过建立ActiveX控件时看其所在盘 符actxcontrolselect
regsvr32 OWC10.DLL即可
如果 感觉这样比较麻烦,可将被注册的ActiveX 控件拷贝到windowssystem下,这样我们也 不用在注册时输入控件的路径了。直接regsvr32 OWC10.DLL即可,卸载的话 就regsvr32u OWC10.DLL

4.关于ACTIVEX没注册问题
如果GUI中用到的spreadsheet没有注册,则会提示如下错误:

Error using==>actxcontrol
Control creation failed.Invalid ProglD 'OWC10.Spreadsheet.10'


解决办法:

1) Locate the ActiveX control file/s and transfer them to the client computer. Or install the ActiveX control on the target machine.
2) Using a DOS command window, navigate to the directory where the OCX file for the ActiveX control was placed.
3) Register the control using the following command:
regsvr32 <myfile>.OCX(或regsvr32 <myfile>.DLL)
Where myfile is the name of your ActiveX control. A message should appear indicating success.
4) Run your GUI executable.

http://www.mathworks.com/support/solutions/en/data/1-3NC15G/


5.MATLAB(Release 14 Service Pack 3 (R14SP3))BUG

这是一个BUG,但不会影响编译及后面的程序执行。这是在编译一个只有图像和按钮的GUI时发现的。

错误提示:

Warning: C:Program FilesMathWorksMATLAB Component Runtimev70toolboxlocalpathdef.m not found.
Toolbox Path Cache is not being used.Type 'help toolbox_path_cache' for more info.


解决办法:

One way to work around this issue is to create a blank pathdef.m and place it in the directory

$MCR\toolbox\local\

where $MCR is the directory where the MATLAB Component Runtime (MCR) has been installed on your system.Another way to workaround this issue is to create a new copy of startup.m and disable warning messages as follows:

warning off

Ensure that the startup.m file is on the MATLAB path.

Note that after making the modifications, you will need to recompile your application

http://www.mathworks.com/support ... ml?solution=1-ON0NN





友情提示:MATLAB主页的support版面是非常不错的技术支持网 站,有问题可以到这上面搜搜 http://www.mathworks.com/support/

https://wap.sciencenet.cn/blog-316653-343605.html


下一篇:定时关机-打开文件软件MicroShut8
收藏 IP: .*| 热度|

0

发表评论 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-3-29 02:35

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部