From: Manal Samy on
I just not able to send an array of strings to Tcl,

I'm using: Tcl_SetObjResult(interp,ResultList);

also I don't know even how to debug on that?
From: Harald Oehlmann on
On 6 Aug., 12:17, Manal Samy <manal.sa...(a)gmail.com> wrote:
> I just not able to send an array of strings to Tcl,
> I'm using:  Tcl_SetObjResult(interp,ResultList);

You have something like:
char Array[3];
Array[0] = "ABC";
Array[1] = "DEF";
Array[2] = "GHI";
and you want to get this as the result of a tcl command implemented in
C.

I would suggest you to return a list.
Sample code:
Tcl_Obj *lResult;
lResult = Tcl_GetObjResult( interp );
for ( Index = 0; Index < 3; Index++)
{
Tcl_Obj *poStr;
poStr = Tcl_NewStringObj( Array[Index], -1 );
if ( TCL_OK !=
Tcl_ListObjAppendElement( interp, lResult, poStr))
{
// > Error already set in interp
return TCL_ERROR;
}
}
return TCL_OK;


>
> also I don't know even how to debug on that?

I am on windows using MS-VC6 and use two ways:
- just printf to standard out to write to the tcl console
- I can debug the dll as a normal program in MS-VC++.
Within MS-VC properties select debugging
Put wish8.5.exe as debugging executable, put a start script as
parameters.
Write a start script which loads your library and invoke it.
If you set a break point within your source code you may debug it
normally.

Hope this helps,
Harald