我从Delphi中调用COM组件,为何出现这个问题? 恳求帮助,在线等(100分)
大家好,我现在正在做我的硕士论文,基本思路是从Delphi中调用Matlab制作的COM组件,现在COM组件已经制作好了,可是在Delphi中调用时老是出现错误: External Exception : E06D7363,
有关信息如下:
在Matlab中可以正确允许:
>> [A,area,density,standard,Qj,n,Hcrl,L,Hgrd,Zx,Zy,popsize,gen]=data2;
>> [HH,h,il,D,cmd,I,v,total,cost,pipeL,TL]=totalprocess(A,area,...
density,standard,Qj,n,Hcrl,L,Hgrd,Zx,Zy,popsize,gen)
HH(:,:,1) =...(帖子内容太长,在此省略)
h =
Columns 1 through 9
0.0489 0.0944 0.1303 0.1375 0.1375 0.1650 0.2204 0.2600 0.4900
Columns 10 through 18
0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6300 0.2600
Columns 19 through 25
0.3194 0.4376 0.4467 0.4735 0.4888 0.5001 0.7730
。。。。。。
TL =
6.7907e+003
>>
其中的data2文件:
function [A,area,density,standard,Qj,n,Hcrl,L,Hgrd,Zx,Zy,popsize,gen]=data2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for Q=liuliang(A,Qb,Qj) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A=[
1 2
2 3
3 4
4 5
5 6
6 15
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 25
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
]; %各管段起止节点号
area=[
1.67
5.05
6.77
2.11
2.11
7.09
0
0
2.64
23.95
19.45
2.86
11.06
4.07
3.96
3.41
3.43
0
0
0
5.36
20.03
12.67
9.62
3.39
];% 注意面积对应的是管段起始的节点
Qj=[
0
0
0
0
0
0
44
29
216.9
0
0
0
0
0
0
0
0
66.4
56
142
0
0
0
0
0
];% 各管段不是直接从“计算上游”获得的集中流量流量
%单位是L/s,还要注意这个数据是按照节点的顺序来的
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%for [HHH,HH,h,il]=gaocheng(n,Q,D,L,A,cmd,Hcrl,i,Hgrd) %%%%%%%%%%
L=[
316.23
347.31
301.04
180.28
422.97
476.34
246.22
269.26
325
395.28
360.56
246.22
208.93
172.19
347.31
158.11
167.71
111.8
292.62
134.63
134.63
279.51
325
357.95
213.6
];
Hgrd=[
152.53
152.23
151.74
151.13
150.72
150.36
150.83
150.61
150.37
150.29
150.75
150.72
150.42
150.05
149.58
148.7
148
150.02
149.8
149.78
149.78
149.28
148.46
148.52
149
149
];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
density=400;
standard=120;
n=0.014;
Hcrl=1.3;
Zx=0;
Zy=0;
popsize=15;
gen=20;
在Matlab中运行没有问题,我把totalprocess这个函数用comtool做成了COM组件,其基本信息如下:
Name - PAISHUI910
Version
1.0
Type Library: Paishui910 1.0 Type Library
Library ID: {298EA5CC-DD14-4A37-9B59-1A435F847B56}
File Name: D:\MATLAB7\work\myproject2\Paishui910\distrib\Paishui910_1_0.dll
Classes
Name: Paishui910class
Class ID: {CFF50E02-A29B-444D-B5D2-B9FEA90C78EA}
Program ID: Paishui910.Paishui910class.1_0
In Process Server: D:\MATLAB7\work\myproject2\Paishui910\distrib\Paishui910_1_0.dll
Methods
function [HH, h, il, D, cmd, I, v, total, cost, pipeL, TL] = totalprocess(A, area, density, standard, Qj, n, Hcrl, L, Hgrd, Zx, Zy, popsize, gen)
Properties
Events
Interfaces
Name: IPaishui910class
Interface ID: {A253C3E1-1EE0-40DE-A1C3-0BD1E5D73392}