오후 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);
}
조경민 생략 아규먼트시 쓰는 법 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);
}
'KB > MFC/Win32' 카테고리의 다른 글
ADO 레코드셋이 열려있는지 판단하기 (0) | 2004.03.19 |
---|---|
VAIRNAT안에 인터페이스 포인터를 넣기 (0) | 2004.03.19 |
USES_COMVERSION (1) | 2004.03.19 |
[com] _main이 없다며 unresolved fatal linking error가 날때 (0) | 2004.03.19 |
ATLCOM에서 Enum 형태의 인자를 쓰기 (0) | 2004.03.19 |