F
FreeFly
Unregistered / Unconfirmed
GUEST, unregistred user!
我通过Matcom利用VC++6.0的编译器将Matlab的.M文件
转换成Dll,Matcom在生成DLL文件的同时,还生成了VB的模块
文件,这样可以很方便的在VB中调用生成好的DLL.
我将一个自己编的test_fft.m转换成test_fft.dll,
在VB模块中是这样定义的:
Declare Function test_fft_v
Lib "test_fft.dll"
Alias "_test_fft_v@20"
(ByVal emsg As String, ByVal nlhs As Long,
ByRef plhs As Long, ByVal nrhs As Long,
ByRef prhs As Long) As Long
只要在VB中先引用MMatrix COM对象,通过下面的代码就可以
用了,
dim emsg as string*1024
dim plhs as long
dim prhs as long
dim error as long
plhs = 0
prhs = 0
error = test_fft_v(emsg,0,plhs,0,prhs)
我想在Delphi中调用这个DLL,我是这样声明的,
function test_fft_v(emsg : string;nlhs as integer;
var plhs as integer;nrhs as integer;
var prhs as integer) : integer;
extern 'test_fft.dll';
然后从import type library中import进MMatrix
用这样的代码进行访问:
var
emsg : string;
plhs : integer;
prhs : integer;
error : integer;
begin
emsg := '';
plhs := 0;
prhs := 0;
error := test_fft_v(emsg,0,plhs,0,prhs);
end;
编译连接都没有问题,但在运行时出现'can't create precess'
的错误,清高手帮忙,这是什么原因,如何解决?先谢了!
另:我用的是delphi4.0,Matcom4.5 for vc++,VB5.0
转换成Dll,Matcom在生成DLL文件的同时,还生成了VB的模块
文件,这样可以很方便的在VB中调用生成好的DLL.
我将一个自己编的test_fft.m转换成test_fft.dll,
在VB模块中是这样定义的:
Declare Function test_fft_v
Lib "test_fft.dll"
Alias "_test_fft_v@20"
(ByVal emsg As String, ByVal nlhs As Long,
ByRef plhs As Long, ByVal nrhs As Long,
ByRef prhs As Long) As Long
只要在VB中先引用MMatrix COM对象,通过下面的代码就可以
用了,
dim emsg as string*1024
dim plhs as long
dim prhs as long
dim error as long
plhs = 0
prhs = 0
error = test_fft_v(emsg,0,plhs,0,prhs)
我想在Delphi中调用这个DLL,我是这样声明的,
function test_fft_v(emsg : string;nlhs as integer;
var plhs as integer;nrhs as integer;
var prhs as integer) : integer;
extern 'test_fft.dll';
然后从import type library中import进MMatrix
用这样的代码进行访问:
var
emsg : string;
plhs : integer;
prhs : integer;
error : integer;
begin
emsg := '';
plhs := 0;
prhs := 0;
error := test_fft_v(emsg,0,plhs,0,prhs);
end;
编译连接都没有问题,但在运行时出现'can't create precess'
的错误,清高手帮忙,这是什么原因,如何解决?先谢了!
另:我用的是delphi4.0,Matcom4.5 for vc++,VB5.0