mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
now handling setting by reference
This commit is contained in:
parent
9c73a2344d
commit
a8b76b9599
@ -94,7 +94,7 @@ HRESULT PPInterface::Invoke(int nType, IDispatch* pDisp, CString& ptName, VARIAN
|
|||||||
dp.rgvarg = pArgs;
|
dp.rgvarg = pArgs;
|
||||||
|
|
||||||
// Handle special-case for property-puts!
|
// Handle special-case for property-puts!
|
||||||
if( nType & DISPATCH_PROPERTYPUT )
|
if( nType & DISPATCH_PROPERTYPUT || nType & DISPATCH_PROPERTYPUTREF )
|
||||||
{
|
{
|
||||||
dp.cNamedArgs = 1;
|
dp.cNamedArgs = 1;
|
||||||
dp.rgdispidNamedArgs = &dispidNamed;
|
dp.rgdispidNamedArgs = &dispidNamed;
|
||||||
@ -105,6 +105,10 @@ HRESULT PPInterface::Invoke(int nType, IDispatch* pDisp, CString& ptName, VARIAN
|
|||||||
{
|
{
|
||||||
hr = pDispEx->InvokeEx(dispID, LOCALE_USER_DEFAULT,
|
hr = pDispEx->InvokeEx(dispID, LOCALE_USER_DEFAULT,
|
||||||
nType, &dp, pvResult, NULL, NULL);
|
nType, &dp, pvResult, NULL, NULL);
|
||||||
|
if ( FAILED( hr ) )
|
||||||
|
{
|
||||||
|
pDispEx->DeleteMemberByDispID( dispID );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -201,7 +205,14 @@ HRESULT PPInterface::SetProperty( CComPtr<IDispatch>& pDispatch, CString& name,
|
|||||||
}
|
}
|
||||||
if ( SUCCEEDED( hr ) )
|
if ( SUCCEEDED( hr ) )
|
||||||
{
|
{
|
||||||
hr = Invoke( DISPATCH_PROPERTYPUT, pDispatch, name, &varResult, 1, &varValue );
|
if ( varValue.vt == VT_DISPATCH )
|
||||||
|
{
|
||||||
|
hr = Invoke( DISPATCH_PROPERTYPUTREF, pDispatch, name, &varResult, 1, &varValue );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hr = Invoke( DISPATCH_PROPERTYPUT, pDispatch, name, &varResult, 1, &varValue );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user