library ddeexec;
uses PasMex32,Windows,DDEML,dde_init;
{jede dieser DLLs auf andere Basisadressen relozieren}
{$IMAGEBASE $10020000}
procedure mexFunction(nlhs:LongInt; var plhs:TMatArr;
nrhs:LongInt; const prhs:TMatArr); stdcall;
var
conv: HConv;
command: PChar;
timeout: LongInt;
begin
TestInputArgs(nrhs,prhs,2,4,6,9);
conv:=Round(mxGetScalar(prhs[0]));
command:=mxArrayToString(prhs[1]);
{das dritte Argument "item" wird vllig ignoriert}
timeout:=StdTimeOut;
if nrhs=4 then timeout:=Round(mxGetScalar(prhs[3]));
plhs[0]:=mxCreateDoubleMatrix(1,1,mxReal);
mxGetPr(plhs[0])^:=LongInt(DdeClientTransaction(
command,lstrlen(command)+1,conv,0,CF_Text,XTYP_Execute,timeout,nil));
{BOOL-Rckgabe}
mxSetLogical(plhs[0]); {neu bei Matlab5}
mxFree(command);
HandleDdeError(0); {falls etwas schiefging: anzeigen!}
end;
exports
mexFunction;
begin
DisableThreadLibraryCalls(HInstance);
end.
Detected encoding: UTF-8 | 0
|