Click to See Complete Forum and Search --> : Slider probrem!!! - urgent (really)


chris b
May 28th, 1999, 11:08 AM
I am writing an app using MFC. I created a class:
CFormCommandView derived from CFormView. I want to embed a slider control in it. I did it using a Class Wizard, but obviously something is wrong - when I call SetRange I get an 'assertion failed' notice - it looks like my slider is not attached to any window - ASSERT(::IsWindow(m_hWnd)) fails.
What's wrong? MSDN says I do not have to call Create when I use Wizard.

Thank you very much in advance!

srinath
May 28th, 1999, 12:11 PM
your problem is due to the fact that you may be trying to set range before the window is being created.
try doing it in the WM_INITDIALOG handler for the formview derived class.

chris b
May 28th, 1999, 01:11 PM
I call the SetRange in OnCreate (WM_CREATE). I wanted to call in in OnInitDialog like you suggested, but WM_INITDIALOG doesn't appear in the Wizard's message map window. Is there a message I could use instead???

srinath
June 9th, 1999, 11:57 AM
after you open class wizard go to the class info tab. there set the filter to Dialog . you will get the
WM_INITDIALOG message in the Messages tab.

sri