void ChwrDlg::SetStrokeThickness(bool isThick)
{
/*the stroke thickness is created by InkDrawAttri and set in the Inkpicture*/
CComPtr<IInkPicture> ip;
ip.CoCreateInstance(CLSID_InkPicture);
/*1. create ink drawing attr
2. get the id of the ink_drawing_attr's default attr by name
3. get CWnd of InkPicture by its id
4. get the attr of InkPicture by id
5. modify the attr
6. put back the attr to the InkPicture
*/
CComPtr<IInkDrawingAttributes> spInkDrawAttr = NULL;
DISPID dispid = 0;
OLECHAR *szMembers = OLESTR("DefaultDrawingAttributes");
HRESULT hr = ip->GetIDsOfNames(CLSID_InkDrawingAttributes, &szMembers, 1, LOCALE_SYSTEM_DEFAULT, &dispid);
if (FAILED(hr))
{
AfxMessageBox(TEXT("取EditingMode id出错"));
}
CWnd *InkPicture = GetDlgItem(IDC_INKPICTURE1);
InkPicture->GetProperty(dispid, VT_UNKNOWN, &spInkDrawAttr);
float currWidth;
spInkDrawAttr->get_Width(&currWidth);
spInkDrawAttr->put_Width(currWidth + 20);
InkPicture->SetProperty(dispid, VT_DISPATCH, spInkDrawAttr);
ip.Release();
}