主题:[讨论]我快急死了,高手请进来看看(回复给分)[我已经自己解决,不再给分,谢谢大家关注]
IDispatch *pDispatchNow;
pFlashObjNow->get_object(&pDispatchNow);//得到Flash对象的IDispatch接口
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
VARIANT var;
BSTR bstrName( L"movie" );
DISPID dispid;
OLECHAR *pbName = bName;
unsigned int ErrValue;
VARIANTARG PutVal;
PutVal.vt = VT_BSTR;
PutVal.bstrVal = _T("Image/head.swf");
DISPPARAMS PutArgs;
PutArgs.cArgs = 1;
PutArgs.rgdispidNamedArgs = NULL;
PutArgs.rgvarg = &PutVal;
PutArgs.cNamedArgs =0;
if(S_OK==pDispatchNow->GetIDsOfNames(IID_NULL, &pbName, 1, LOCALE_USER_DEFAULT, &dispid))
{
//获取原Flash的URL
if(S_OK == pDispatchNow->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, &dispparamsNoArgs, &var, NULL, &ErrValue ))
{
T1 = _T("原SWF:");
T1 += var.bstrVal;
AfxMessageBox(T1);
}
//设置新
HRESULT hrSet;
hrSet = pDispatchNow->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYPUT, &PutArgs, NULL, NULL, &ErrValue );
if(S_OK == hrSet)
{
T1 = _T("新SWF:");
T1 += var.bstrVal;
AfxMessageBox(T1);
}
else
{
T1.Format(_T("%d"),hrSet);
AfxMessageBox( T1 );
}
};