|
-
October 19th, 2011, 05:22 AM
#16
Re: Create Combobox with ToolTips
 Originally Posted by symreds
...but virtual PreSubclassWindow is already implemented in the code we download. ...
Perhaps...
But you haven't shown yet how exactly it is declared/defined in *your* project ...
Victor Nijegorodov
-
October 19th, 2011, 06:02 AM
#17
Re: Create Combobox with ToolTips
 Originally Posted by symreds
...but virtual PreSubclassWindow is already implemented in the code we download. ...
Perhaps...
But you haven't shown yet how exactly it is declared/defined in *your* project ...
Victor Nijegorodov
-
October 19th, 2011, 06:36 AM
#18
Re: Create Combobox with ToolTips
Of course I cannot post my code here because my company has rights on it. Anyway the code is more or less this:
Code:
CTooltipComboBox *pCombo = (CTooltipComboBox*)GetDlgItem( IDC_... ); // IDC_.... resource index of my combo
for( number of combo items )
{
pCombo->AddString( combo item name );
pCombo->SetItemTip( counter, tooltip text );
}
Last edited by symreds; October 19th, 2011 at 06:40 AM.
-
October 19th, 2011, 06:48 AM
#19
Re: Create Combobox with ToolTips
 Originally Posted by symreds
Of course I cannot post my code here because my company has rights on it. Anyway the code is more or less this:
Code:
CTooltipComboBox *pCombo = (CTooltipComboBox*)GetDlgItem( IDC_... ); // IDC_.... resource index of my combo
for( number of combo items )
{
pCombo->AddString( combo item name );
pCombo->SetItemTip( counter, tooltip text );
}
Are you kidding? 
Where are the decaration/definition of PreSubclassWindow that "is not automatically called"?
Besides, why are you using GetDlgItem? didn't you implement the control member variable for your combobox?
Victor Nijegorodov
-
October 19th, 2011, 06:58 AM
#20
Re: Create Combobox with ToolTips
Declaration/definition of PreSubclassWindow are in CTooltipComboBox.h/.cpp
Anyway, I've always used GetDlgItem instead of a control variable... I think it's the same...
Last edited by symreds; October 19th, 2011 at 07:01 AM.
-
October 19th, 2011, 07:19 AM
#21
Re: Create Combobox with ToolTips
 Originally Posted by symreds
Anyway, I've always used GetDlgItem instead of a control variable... I think it's the same...
I don't care what you have "lways used".
But my question is: do you only "think it's the same" or you are sure?
And how about the article you referred to:
To use this combo box, follow the following steps:
- Include TooltipComboBox.h, TooltipComboBox.cpp, TooltipListCtrl.h and TooltipListCtrl.cpp in your project.
- In the resource editor create a droplist combobox.
- Create a control member variable for the combobox in VC's classwizard.
- Include TooltipComboBox.h and replace CComboBox with CTooltipComboBox in your .h file. Also include afxtempl.h to support CMap.
- To have your own tips, you can either use SetItemTip, SetComboTip functions, or replace GetItemTip function in CTooltipListCtrl, and GetComboTip function in CTooltipComboBox.
Victor Nijegorodov
-
October 19th, 2011, 07:33 AM
#22
Re: Create Combobox with ToolTips
Ok, I'm trying to create a control member variable...
I use VS2010 => Class View => I find my dialog class => right click => then? (is this the right procedure?)
-
October 19th, 2011, 07:47 AM
#23
Re: Create Combobox with ToolTips
Victor Nijegorodov
-
October 19th, 2011, 08:21 AM
#24
Re: Create Combobox with ToolTips
Ok... got it, now the application doesn't crash anymore (and I hit the breakpoint inside PreSubclassWindow()!) but now AddStrings() is no more working: I created an empty combo... I'm going to investigate...
-
October 19th, 2011, 08:24 AM
#25
Re: Create Combobox with ToolTips
 Originally Posted by symreds
... now AddStrings() is no more working: I created an empty combo...
What is AddStrings() and how do you call it?
Victor Nijegorodov
-
October 19th, 2011, 08:58 AM
#26
Re: Create Combobox with ToolTips
Sorry, typo error, I mean CComboBox::AddString() (without "s")
-
October 19th, 2011, 09:02 AM
#27
Re: Create Combobox with ToolTips
 Originally Posted by symreds
Sorry, typo error, I mean CComboBox::AddString() (without "s")
Well, how, when, and where from do you call it?
Victor Nijegorodov
-
October 19th, 2011, 09:07 AM
#28
Re: Create Combobox with ToolTips
Post #18 (of course without initial GetDlgItem()...)
That code is into MyDialog::OnInitDialog()
Last edited by symreds; October 19th, 2011 at 09:10 AM.
-
October 19th, 2011, 09:29 AM
#29
Re: Create Combobox with ToolTips
 Originally Posted by symreds
Post #18 (of course without initial GetDlgItem()...)
Isn't copy/paste the actual code snippet easier for you than typing in this sentence? 
 Originally Posted by symreds
That code is into MyDialog::OnInitDialog()
Well, it can be everywhere, but it doesn't help us to see it!
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|