MCPcopy Create free account
hub / github.com/LegacyUpdate/LegacyUpdate / GetExtent

Method GetExtent

LegacyUpdate/ProgressBarControl.cpp:130–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128#pragma mark - IOleObject
129
130STDMETHODIMP 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
150STDMETHODIMP CProgressBarControl_IOleObject::SetExtent(DWORD dwDrawAspect, SIZEL *psizel) {
151 if (psizel == NULL) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected