-// $Id: Arguments.cpp 5 2005-02-16 14:57:24Z cthuang $
+// $Id: Arguments.cpp 20 2005-05-04 16:53:05Z cthuang $
#include "Arguments.h"
#include "Extension.h"
#include "TclObject.h"
// This variant indicates a missing optional argument.
m_args[argIndex] = vtMissing;
- } else if (parameter.flags() & PARAMFLAG_FOUT) {
- // For out parameters, set a pointer to where the out value
- // will be stored.
+ } else if (parameter.type().pointerCount() > 0) {
+ // The argument is passed by reference.
switch (vt) {
case VT_INT:
}
if (parameter.flags() & PARAMFLAG_FIN) {
- // Set the value for an in/out parameter.
- Tcl_Obj *pValue = Tcl_ObjGetVar2(
- interp, pObj, NULL, TCL_LEAVE_ERR_MSG);
- if (pValue == 0) {
- return TCL_ERROR;
+ if (parameter.flags() & PARAMFLAG_FOUT) {
+ // Set the value for an in/out parameter.
+ Tcl_Obj *pValue = Tcl_ObjGetVar2(
+ interp, pObj, NULL, TCL_LEAVE_ERR_MSG);
+ if (pValue == 0) {
+ return TCL_ERROR;
+ }
+
+ TclObject value(pValue);
+
+ // If the argument is an interface pointer, increment its
+ // reference count because the _variant_t destructor will
+ // release it.
+ value.toNativeValue(
+ &m_outValues[argIndex], parameter.type(), interp, true);
+ } else {
+ // If the argument is an interface pointer, increment its
+ // reference count because the _variant_t destructor will
+ // release it.
+ argument.toNativeValue(
+ &m_outValues[argIndex], parameter.type(), interp, true);
}
-
- TclObject value(pValue);
-
- // If the argument is an interface pointer, increment its reference
- // count because the _variant_t destructor will release it.
- value.toNativeValue(
- &m_outValues[argIndex], parameter.type(), interp, true);
} else {
if (vt == VT_UNKNOWN) {
m_outValues[argIndex].vt = vt;