Question: external calling / use of arrays

For testing an external routine against Maple I have something like

  Gamma_mpl:=define_external(
    'Gamma_mpl',
    'C',
    'Z'::ARRAY(1..n,datatype=float[8]),
    'result'::ARRAY(1..n,datatype=float[8]),
    LIB=theDLL);

where the function in the DLL (compiled with Dev-C++) is like

  extern "C" __declspec( dllexport ) __stdcall 
  void Gamma_mpl(double *Z, double *R){ ... some code  ...}

It takes the input in Z and updates values in R.

The following works as expected:

  z:= -1.1 + 2.1*I*0:
  # provide memory
  Z:=Array(1..2, order= Fortran_order, datatype= float[8]):
  R:=Array(1..2, order= Fortran_order, datatype= float[8]):

  Z[1] := Re(evalf(z)): Z[2] := Im(evalf(z)):   # set input
  Gamma_mpl(Z, R);                              # call the DLL
  R[1]+R[2]*I;                                  # show result

                      9.71480638290291232 + 0. I

Fine. Now I want that stuff to be wrapped into a Maple proc:

  Gamma_DLL:= proc(z::complex)
  local Z, R, result;
  Z:=Array(1..2, order= Fortran_order, datatype= float[8]):
  R:=Array(1..2, order= Fortran_order, datatype= float[8]):
  Z[1] := Re(evalf(z)); Z[2] := Im(evalf(z));
  Gamma_mpl(Z, R);
  result := R[1]+R[2]*I;
  simplify(%,zero);
  end proc;

but a call Gamma_DLL(z) produces an immediate crash "Excecution
stopped: Stack limit reached" - what ever I try.  Sigh :-(

Where is my mistake, what to do (with M10.06 on WinXP)? Any help?

Edited: the crash happens in calling Gamma_mpl in the proc, not
through allocating the Arrays.
Please Wait...