L
livestone
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
==========================================================================
.....
_Document wdDoc;
Range wdRange;
wdDoc.AttachDispatch(lpDisp);
wdRange = wdDoc.Range(COleVariant( (long)DISP_E_PARAMNOTFOUND, VT_ERROR ),
COleVariant( (long)DISP_E_PARAMNOTFOUND, VT_ERROR ) );
COleVariant VLeft, VTop, VWidth, VHeight;
VLeft = wdRange.GetStart();
VTop = wdRange.GetStart();
VWidth = wdRange.GetEnd();
VHeight = wdRange.GetEnd();
Shapes oShapes;
lpDisp = wdDoc.GetShapes();
oShapes.AttachDispatch(lpDisp);
Shape oShape;
COleVariant vTrue((short)TRUE), vFalse((short)FALSE);
oShape = oShapes.AddPicture(
"c://a.bmp",
vFalse,
vTrue,
VLeft,
VTop,
VWidth,
VHeight,
VHeight
);
==========================================================================
运行到AddPicture时候捕获异常,报告"找不到成员"
是什么问题,请大侠指教!
==========================================================================
.....
_Document wdDoc;
Range wdRange;
wdDoc.AttachDispatch(lpDisp);
wdRange = wdDoc.Range(COleVariant( (long)DISP_E_PARAMNOTFOUND, VT_ERROR ),
COleVariant( (long)DISP_E_PARAMNOTFOUND, VT_ERROR ) );
COleVariant VLeft, VTop, VWidth, VHeight;
VLeft = wdRange.GetStart();
VTop = wdRange.GetStart();
VWidth = wdRange.GetEnd();
VHeight = wdRange.GetEnd();
Shapes oShapes;
lpDisp = wdDoc.GetShapes();
oShapes.AttachDispatch(lpDisp);
Shape oShape;
COleVariant vTrue((short)TRUE), vFalse((short)FALSE);
oShape = oShapes.AddPicture(
"c://a.bmp",
vFalse,
vTrue,
VLeft,
VTop,
VWidth,
VHeight,
VHeight
);
==========================================================================
运行到AddPicture时候捕获异常,报告"找不到成员"
是什么问题,请大侠指教!