Passing PChar arrays as DLL function parameter

Hi

I'm converting C header trying to call DLL function from DELPHI:

Variant 1 (from header file)
typedef unsigned char MYBYTE;
#define APIDEF  FAR pascal _export
#define APIDCL  extern APIDEF
int APIDCL  process (int con_handle, char FAR *sub_name,
                        int par_num, MYBYTE FAR * FAR *param_val,
                        int FAR *param_type);

Variant 2 (from manual)

int process(con_handle, sub_name, param_num,param_val,param_type)
int con_handle;
char *sub_name;
int param_no;
MYBYTE *param_val[];
int param_type[];

I have such variants for my interface file (sure I test only one at one
time)
=============
function process (con_handle : Integer; sub_name : PChar;
par_num : Integer; param_val : array of PChar; param_type : array of
Integer) : Integer;

function ud_rpc (con_handle : Integer; sub_name : PChar;
par_num : Integer; param_val : array of PChar; param_type : array of
Integer) : Integer; cdecl;

function ud_rpc (con_handle : Integer; sub_name : PChar;
par_num : Integer; var param_val,param_type) : Integer; cdecl;

=============
Calling procedure look like
var
    Temp : array [0..10] of Char;
    Temp2 : array [0..10] of Char;
    Par : array [1..2] of Pchar;
    ParT : array [1..2] of Integer;
begin
<skipped>
    ParT[1] := UNISTRING;     ParT[2] := UNISTRING;
    Temp[0] := 'B';     Temp[1] := #0;
    Temp2 [0] := #0;
    Par[1]  := Temp;     Par[2]  := Temp2;
    GetMem(MyPChar,20);
    StrPCopy(MyPChar,'TEST3');
    i:= process(handle,MyPChar,1, Par,ParT);
<skipped>

================================

I think that my problem in passing  array parameters to DLL function.
Should I use cdecl here? Is anybody has experience in declaring parameters
arrays
and passing them to DLL?

Any help appriciated
--
Alexander Tarasul
Delphi Developer
Chicago, IL
E-mail : shl...@ripco.com