Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C & Tcl: Export pointer on array Tcl to C

Status
Not open for further replies.

mgerber

Programmer
Nov 5, 2004
2
CH
Hello, my name is Michaël. Now I am in work of Diploma and I doing an interface graphic in Tcl/Tk. It's the first time for me Tcl/TK, I am initial, excuse me if my question is stupid.

I would like to call functions written out of C++ since TCL/TK. I used SWIG for created a DLL readable by TCL/TK.

Until here, it's OK. I successful to call a C++ function which has like parameter an Integer (since TCL/TK).
Then I desired called my function with like parameter a pointer on array. It's doesn't work !!

This error is generated:
Type error. Expected a pointer
while executing
"Interface_Diplome Tab"

My question is:
How I must make for send a pointer on table? Is my array well to declare? Which error I made?

Tanks you very much !!!

#####declaration of my function C
int Interface_Diplome(int *);

#####my programm Tcl
#creation of my array
set tab(0) 7
set tab(1) 6
set tab(2) 5
set tab(3) 4
set tab(4) 3
set tab(5) 2
set tab(6) 1
set tab(7) 0

#call the dll
load Interface_Diplome.dll Interface_Diplome

#Call the function "Interface_Diplome" with like argument a pointer on array
Interface_Diplome tab
 
Not, I din't know. I will test!! Thank you very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top