WEB开发网
开发学院软件开发VC 基于ole的VC和matlab混合编程方法 阅读

基于ole的VC和matlab混合编程方法

 2007-03-17 21:25:13 来源:WEB开发网   
核心提示:运行环境:VC++ 6.0 MATLAB6.5 Windows XP此方法的实现是在网上各位前辈的基础上完成的,特别是参考了哈工大振动论坛上的一篇文章,现在,基于ole的VC和matlab混合编程方法,就具体谈一下怎么把一个M文件或MEX文件,做成可以脱离MATLAB环境的COM组件,完成编译器的设置,>>

运行环境:VC++ 6.0 MATLAB6.5 Windows XP

此方法的实现是在网上各位前辈的基础上完成的。特别是参考了哈工大振动论坛上的一篇文章,现在,就具体谈一下怎么把一个M文件或MEX文件,做成可以脱离MATLAB环境的COM组件,并且被VC++调用。

1. 首先,设置合适的编译器。在MATLAB命令窗口里敲:>>mbuild –setup,完成编译器的设置。

>>mbuild –setup
Please choose your compiler for building standalone MATLAB applications:
Would you like mbuild to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc C version 2.4 in D:MATLAB6P5syslcc
[2] Microsoft Visual C/C++ version 6.0 in C:Program FilesMicrosoft Visual Studio
[0] None
Compiler: 2
Please verify your choices:
Compiler: Microsoft Visual C/C++ 6.0
Location: C:Program FilesMicrosoft Visual Studio
Are these correct?([y]/n): y
The default options file:
"C:Documents and SettingslilixinApplication DataMathWorksMATLABR13compopts.bat"
is being updated from D:MATLAB6P5BINWIN32mbuildoptsmsvc60compp.bat...
--> "D:MATLAB6p5inwin32mwregsvr D:MATLAB6p5inwin32mwcomutil.dll"
DllRegisterServer in D:MATLAB6p5inwin32mwcomutil.dll succeeded
--> "D:MATLAB6p5inwin32mwregsvr D:MATLAB6p5inwin32mwcommgr.dll"
DllRegisterServer in D:MATLAB6p5inwin32mwcommgr.dll succeeded
Installing the MATLAB Visual Studio add-in ...
Updated C:Program FilesMicrosoft Visual Studiocommonmsdev98  emplateMATLABWizard.awx
from D:MATLAB6P5BINWIN32MATLABWizard.awx
Updated C:Program FilesMicrosoft Visual Studiocommonmsdev98  emplateMATLABWizard.hlp
from D:MATLAB6P5BINWIN32MATLABWizard.hlp
Updated C:Program FilesMicrosoft Visual Studiocommonmsdev98addinsMATLABAddin.dll
from D:MATLAB6P5BINWIN32MATLABAddin.dll
Merged D:MATLAB6P5BINWIN32usertype.dat
with C:Program FilesMicrosoft Visual Studiocommonmsdev98inusertype.dat

2. 设置系统路径。我的电脑->属性->高级->环境变量->系统变量->Path选项,增加以下路径:

1 2 3  下一页

Tags:基于 ole VC

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接