I am trying to run a stored procedure with output params from ODBC program in C++
something like

retcode = SQLExecDirect (hstmt,(SQLCHAR *) "{call sp_mycall(?,?)}",SQL_NTS);
The second paramter is bind as SQL_PARAM_INPUT_OUTPUT
when executing it the stored procedure runs fine but how do I get the result in the 2nd parameter
Running the same stored procedure from query analyzer works just fine
exec sp_my call 1,@myvar output

Any idea how to get the value ?
Thanks