Source file: /~heha/BETA/matdde7.zip/SRC/DDEREQ.PAS

library ddereq;
uses PasMex32,Windows,DDEML,dde_init;
{jede dieser DLLs auf andere Basisadressen relozieren}
{$IMAGEBASE $10040000}

procedure mexFunction(nlhs:LongInt; var plhs:TMatArr;
  nrhs:LongInt; const prhs:TMatArr); stdcall;
 var
  conv: HConv;
  item: Hsz;
  cf: UInt;
  format: EClip;
  timeout: LongInt;
  outchar: Bool;
  hindata: HDdeData;
{Mehr-als-zwei-dimensionale Matrizen können nur mit CF_MatTable
 übertragen werden}
 begin
  if nlhs=0 then PutErr(16);			{will Ausgabe-Variable!}
  TestInputArgs(nrhs,prhs,2,4,$6,$D);	{ncbn}
  conv:=Round(mxGetScalar(prhs[0]));
  item:=ArrayToStringHandle(prhs[1]);
  outchar:=false; cf:=CF_Text; format:=Text;
  if nrhs>=3 then format:=CheckClipFormat(prhs[2],cf,@outchar);
			{testen & umwandeln in EClip}
  timeout:=StdTimeOut;
  if nrhs=4 then timeout:=Round(mxGetScalar(prhs[3]));

  hindata:=DdeClientTransaction(nil,0,conv,item,cf,XTYP_Request,timeout,nil);
  FreeStringHandle(item);
  if hindata<>0 then begin
   plhs[0]:=DdeDataToArray(hindata,format,outchar);
   DdeFreeDataHandle(hindata);
  end else {keine DDE-Daten: leeres Array liefern!} begin
   plhs[0]:=mxCreateDoubleMatrix(0,0,mxReal);
   mxSetLogical(plhs[0]);	{noch eine hübsche Fehler-Erkennung}
  end;	{nichts zurückliefern! (also leeres Array)}
  HandleDdeError(0);		{falls etwas schiefging: anzeigen!}
 end;

exports
 mexFunction;
begin
 DisableThreadLibraryCalls(HInstance);
end.
Detected encoding: OEM (CP437)1
Wrong umlauts? - Assume file is ANSI (CP1252) encoded