| 128 | #pragma mark - IOleObject |
| 129 | |
| 130 | STDMETHODIMP CProgressBarControl_IOleObject::GetExtent(DWORD dwDrawAspect, SIZEL *psizel) { |
| 131 | if (psizel == NULL) { |
| 132 | return E_POINTER; |
| 133 | } |
| 134 | |
| 135 | if (dwDrawAspect != DVASPECT_CONTENT) { |
| 136 | return DV_E_DVASPECT; |
| 137 | } |
| 138 | |
| 139 | // Convert to HIMETRIC |
| 140 | HDC hdc = GetDC(NULL); |
| 141 | int ppiX = GetDeviceCaps(hdc, LOGPIXELSX); |
| 142 | int ppiY = GetDeviceCaps(hdc, LOGPIXELSY); |
| 143 | ReleaseDC(NULL, hdc); |
| 144 | |
| 145 | psizel->cx = MAP_PIX_TO_LOGHIM(m_pParent->m_width, ppiX); |
| 146 | psizel->cy = MAP_PIX_TO_LOGHIM(m_pParent->m_height, ppiY); |
| 147 | return S_OK; |
| 148 | } |
| 149 | |
| 150 | STDMETHODIMP CProgressBarControl_IOleObject::SetExtent(DWORD dwDrawAspect, SIZEL *psizel) { |
| 151 | if (psizel == NULL) { |
nothing calls this directly
no outgoing calls
no test coverage detected