Re: How to get dialog size?
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:lmgpv35j0oe79cs98c2i5k2vhka7i5no6p@4ax.com...
The units you would use for the scrollbar would be pixels. DBUs have
nothing to do with
the problem. You don't care what size it was at design time, you only
care about what
size it is now.
Yes, I need the size of the dialog in pixels to properly range the scroll
bar. That's what I can't figure out how to get.
You didn't answer my original question: what is the relationship of the
dialog resource to
the view? How is the dialog instantiated?
Here's what little I've been able to figure out. In another post, I've been
told this DLL is a ActiveX control. I've also learned the DLL with the
dialog is registered using regsvr32.exe. Somehow, the exe loads this dll
and the dialog in it, but I haven't been able to figure the linkage out.
In the DLL:
MIDL_DEFINE_GUID(CLSID,
CLSID_BarViewer,0x312F42EB,0x48FD,0x4F97,0x9B,0x9D,0xA9,0xB2,0x7D,0x03,0xD3,0xD3);
The exe seems to use this code to load the dll:
CComPtr<IBarViewer> m_ctrlBarViewer;
QueryControl("BarViewerControl.BarViewer.1", __uuidof(IBarViewer), (void**)
&m_ctrlBarViewer);
..............
void CStandardView::QueryControl(CString strName, REFIID nId, void** pCtrl)
{
CRect rClient;
GetClientRect(&rClient);
SetScaleToFitSize(CSize(rClient.right, rClient.bottom));
m_hwindow = CreateWindow(CAxWindow::GetWndClassName(), strName,
WS_CHILD | WS_VISIBLE, 10, 10, 10, 10, this->m_hWnd, NULL,
::GetModuleHandle(NULL), NULL);
CAxWindow ax;
ax.Attach(m_hwindow);
ax.QueryControl(nId, pCtrl);
::MoveWindow(m_hwindow, 0, 0, rClient.right, rClient.bottom, FALSE);
}
Somehow that loads the dll and the dialog in it. I see no evidence that the
dialog class in the dll is derived from anything, although it must be
because calls like GetClientRect work.
Bruce.