오후 3:33 2000-06-07
조경민 생략 아규먼트시 쓰는 법 VARIANT & optional
=========================================================================


No value was specified. If an optional argument to an Automation
method is left blank, do not pass a VARIANT of type VT_EMPTY.
Instead, pass a VARIANT of type VT_ERROR with a  value of DISP_E_PARAMNOTFOUND.


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

적용시
obj.fnRdsChart         ' 인자값을 생략한다.

idl
[id(15), helpstring("method fnRdsChart")] HRESULT fnRdsChart(, [out,optional] VARIANT* pvsOutFilePath, [in,optional] VARIANT varProperty );


실제 쓸때
STDMETHODIMP CChartGen::fnRdsChart(/*[out,optional]*/ VARIANT* pvsOutFilePath, /*[in,optional]*/ VARIANT varProperty)
{
        // TODO: Add your implementation code here
        if( pvsOutFilePath->vt & VT_ERROR && pvsOutFilePath->scode == DISP_E_PARAMNOTFOUND )
        {
                MessageBox( NULL, "없다.OutFilePath","좋아!",MB_OK);
        }
        
        if( varProperty.vt & VT_ERROR && varProperty.scode == DISP_E_PARAMNOTFOUND )
        {
                MessageBox( NULL, "없다.varProperty","좋아!",MB_OK);
        }

+ Recent posts