Click here to Skip to main content
15,904,926 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: apostrophe or single quote causes problem in query Pin
David Crow8-Jan-08 6:11
David Crow8-Jan-08 6:11 
QuestionHow do I determine the Com Port number of a serial port emulating device? Pin
arnold_w8-Jan-08 5:14
arnold_w8-Jan-08 5:14 
AnswerRe: How do I determine the Com Port number of a serial port emulating device? Pin
Member 7549608-Jan-08 18:01
Member 7549608-Jan-08 18:01 
GeneralRe: How do I determine the Com Port number of a serial port emulating device? Pin
arnold_w9-Jan-08 1:29
arnold_w9-Jan-08 1:29 
GeneralRe: How do I determine the Com Port number of a serial port emulating device? Pin
Member 7549609-Jan-08 3:44
Member 7549609-Jan-08 3:44 
GeneralGDI Resource Manager Pin
Rob Caldecott8-Jan-08 5:04
Rob Caldecott8-Jan-08 5:04 
GeneralRe: GDI Resource Manager Pin
led mike8-Jan-08 7:34
led mike8-Jan-08 7:34 
Questionvirtual function MeasureItem problem(owner draw function problem) Pin
fantasy12158-Jan-08 4:00
fantasy12158-Jan-08 4:00 
I derived my class from CListBox called CMyListBox.
then I write the virtual function MeasureItem to change the height of items.
In my main dialog CMyDialog, construct a CMyListBox object.
CMyListBox m_ctlBox;

and in the CMyDialog::OnInitDialog
<br />
DDX_Control(pDX, BOXID, m_ctlBox);<br />
CMyDialog::OnInitDialog()<br />
{<br />
    m_ctlBox.ModifyStyle(0, LBS_OWNERDRAWFIXED);<br />
}<br />

but it has no affect. The height doesn't change at all. But it executes fine.


Then I've tried comment the code m_ctlBox.ModifyStyle(0, LBS_OWNERDRAWFIXED);
And in the resource editor, I change the property of the ListBox with OwnerDraw to OwnerDrawFixed, then I got compilation assertion error.

What do I miss? And Why do I get the assertion error?But I don't want to create the CMyListBox on the fly at all, cause If I create it on the fly, I can't adjust its position and size.

And in the book «Programming with MFC 2nd», I program as the book shows, it works fine.
First, in the CMyListBox use the PreCreateWindowClass to add the style with LBS_OWNERDRAWFIXED OR LBS_OWNERDRAWVARIABLE.
Second, in the virtual MeasureItem function to change the height.
Third, But you should in the CMyDialog::OnInitDialog to create the CMyListBox on the fly, it should use CMyListBox.Create to create the ListBox, otherwise the CMyListBox::PreCreateWindowClass would not be called to initialize the style with LBS_OWNERDRAWFIXED.
GeneralRe: virtual function MeasureItem problem(owner draw function problem) Pin
Mike O'Neill10-Jan-08 13:31
Mike O'Neill10-Jan-08 13:31 
Questionsizeof char* array Pin
Programm3r8-Jan-08 3:54
Programm3r8-Jan-08 3:54 
GeneralRe: sizeof char* array Pin
toxcct8-Jan-08 4:00
toxcct8-Jan-08 4:00 
QuestionRe: sizeof char* array Pin
Programm3r8-Jan-08 4:09
Programm3r8-Jan-08 4:09 
GeneralRe: sizeof char* array Pin
toxcct8-Jan-08 4:28
toxcct8-Jan-08 4:28 
GeneralRe: sizeof char* array Pin
Programm3r8-Jan-08 4:32
Programm3r8-Jan-08 4:32 
QuestionRe: sizeof char* array Pin
David Crow8-Jan-08 4:56
David Crow8-Jan-08 4:56 
GeneralRe: sizeof char* array Pin
CPallini8-Jan-08 5:00
mveCPallini8-Jan-08 5:00 
GeneralRe: sizeof char* array Pin
Chris Losinger8-Jan-08 4:02
professionalChris Losinger8-Jan-08 4:02 
GeneralRe: sizeof char* array Pin
Programm3r8-Jan-08 4:12
Programm3r8-Jan-08 4:12 
GeneralRe: sizeof char* array Pin
CPallini8-Jan-08 4:13
mveCPallini8-Jan-08 4:13 
GeneralRe: sizeof char* array Pin
Programm3r8-Jan-08 4:18
Programm3r8-Jan-08 4:18 
GeneralLsaLogonUser() + MSV1_0_LM20_LOGON Pin
choupani8-Jan-08 3:49
choupani8-Jan-08 3:49 
QuestionRe: LsaLogonUser() + MSV1_0_LM20_LOGON Pin
Rajesh R Subramanian8-Jan-08 21:44
professionalRajesh R Subramanian8-Jan-08 21:44 
GeneralRe: LsaLogonUser() + MSV1_0_LM20_LOGON Pin
choupani8-Jan-08 21:51
choupani8-Jan-08 21:51 
GeneralRe: LsaLogonUser() + MSV1_0_LM20_LOGON Pin
Rajesh R Subramanian8-Jan-08 22:02
professionalRajesh R Subramanian8-Jan-08 22:02 
GeneralRe: LsaLogonUser() + MSV1_0_LM20_LOGON Pin
choupani8-Jan-08 22:10
choupani8-Jan-08 22:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.