|
|
Okay. Thanks everyone.
I will buy the package at Amazon with Effective STL and Modern C++ Design. Amazon, through database statistics, have determine that readers prefer those two books together.
I am the kind of person who learn via practice and more important via experience. Thus I believe the two Effective C++ books will not as much because they will only "clear" up simple confusions rather than introduce more powerful software designs and implementions. I could ask members to help with all the small missing details.
Kuphryn
|
|
|
|
|
Hi,
In a dialog based application, i have a listbox used for show the
CD/dvd data, including address, hex value and assci. Now i want to
put the tooltip for each item data by using mouse action.
I known that how to select the row and put a tooltip text to it, but how to select the item in a line and put the tooltip text for each item?
Thanks in advance!
chen
|
|
|
|
|
What do you mean a line? Do you mean selecting an entire column? One solution is to just get the coordinate of the mouse pointer, traverse through the items in the listbox, and select one column item from every row.
Kuphryn
|
|
|
|
|
Hi Kuphryn,
Thanks for your reply. In fact, my data is shown as the data shown in
Cywin by jhd command. What i want is select two character each time and show the values (which row it hold, the corresponding dec, binary, and hex values).
My problem is how to select the "words" ?
The following are the data shown in listbox (a line/row)
Address : hex data : assci cod
00000010: 43 44 2D 42 52 49 44 47 45 20 20 20 20 20 20 20 : C D - B R I D G E
The 43 is what i want to selected "words" and then show
its related info in the tooltip.
Best Regards,
chen
|
|
|
|
|
Okay. IN the row with the HEX integers, are each word placed in a separate column? For example:
|43|44|2D|...
Kuphry
|
|
|
|
|
Yes, they are organized as you said.
like this:
43 44 2D 42 52 49 44 47 45 20 20 20 20 20 20 20
Also i want to show tooltip on these "words" only.
Tooltip shouldn't be shown the other items or text.
chen
|
|
|
|
|
Okay. Select the row of HEX integers and then the column of a specific HEX integer.
Look at NM_HOVER and LVN_HOTTRACT events. I am not familiar with handling events for mouse-hover in a CListCtrl. However, I believe the solution to your problem will require an event handler for the mouse-hover. In other words, you need to know what the user is pointing at in order to display the correct tooltip.
Kuphryn
|
|
|
|
|
I need to change the height of my CListCtrl when scrollbars are not present (horizontally). How can I , on the fly detect if the control has scrollbars or not? its columns keep changing so sometimes thee is a scrollbar, and sometimes not...
Thanks,
ns
|
|
|
|
|
One solution is to add messages handlers for both horizontal scroll bar and vertical scroll bar.
WM_HSCROLL - OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
WM_VSCROLL - OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
Kuphryn
|
|
|
|
|
Accumulate the width of each column. If the total exceeds the list control's client area's width, you've got scrollbars. Use GetColumn() to get the column widths and GetClientRect() to get the client rect.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks for the ideas....its a funny problem. When there are sbars, I've shrunk the control down so all you see are the headers and the scrollbar. When there arent enough columns populated, the sb vanishes, and the area it took up, is visible to the user because now the first row of the control shows. I have to make it somehow that it doesnt get this blank area...only the header should show.
|
|
|
|
|
Hmm, you could try using one of SPI_ constants (none seemed obvious) in GetSystemMetrics() to get the height of the list control's header control, and use this value to resize the control.
Alternatively, you could just hide the list control and show a dummy one (of fixed height) with the same columns.
But if you want my honest opinion the concept of a list control that changes its height seems suspect at first glance.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
This part is a real pain, I'm just tossing about ideas. It uses a CP class, and it does okay sort of but not really. Like I repopulate the ctrl each time with new headers and data (new # of columns) . Somethings going horribly wrong with my logic, and I'm staring at it.....aaargh!
Thanks for your ideas though. Soon as the functionality works, I'l apply the cosmetic part..
|
|
|
|
|
I have a demo project with several property pages in one
property sheet. To make a long story short, it's got a wicked
error. The computer just locks up after I click 7-8 property
pages. I have to reboot. I am absolutely stumped. Please,
can I email this demo project to someone who could look at it
and provide feedback? I am stumped beyond words.
Please, please, please, please, please, please, please, please.
My email address is brinasas@yahoo.com
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Are you running a debug build? If so, can you determine where the program locks up? It may be in an infinite loop. Also, what OS are you running?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I developed an ActiveX control in VC++. The control is very simple. It just fires two events simultaneously. I used in VC++ client. Whenever event is received, a message box is displayed. So my client application displays two message boxes immediately.
Now i want to use this control in Visual Basic. But i can only see one dialog box there despite two events are fired from control. I think when first message box is displayed the code is blocked and second message is discarded. Anyone having any idea about this problem, strange this problem is not in VC++ client ??
|
|
|
|
|
VB is single-threaded. Whereas your VC++ client is probably set to the default, multi-threaded setting. If you change your VC++ project setting to single-threaded, you probably will experience the same behavior as the VB client.
VB message boxes are modal and will starve out the single-threaded application message pump until they are closed.
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
Hai Friends,
Can anyone help me to go to a particular topic in a help file when F1 is pressed.
|
|
|
|
|
|
I am currently writing a program which is ported from C++ for DOS. I have a routine which handles the output messages to the screen in DOS, but now I am trying to output it to a ListBox in a Dialog box. Here a fragment of the code i have written..
#include "stdafx.h"
void utility::message()
{
SendMessage(0,WM_MYCALL,0,0);
}
WM_MYCALL is a handler I defined in a dialog class.
Apparently, when I tried this command, nothing really happen. My program is a SDI program. Somehow, WM_MYCALL is not process at all by the dialog class? Why does this happen? Is there something I missed out?
|
|
|
|
|
You must tell it where to send the message. Somehow I dubt you have a dialog box with a HWND of zero.
|
|
|
|
|
Yup, that's right. But I am not sure how to get the handle for my dialog box. Do you have any suggestion? So right now I am sending to the main window.
|
|
|
|
|
mydlg.GetSafeHwnd()
Pavel
Sonork 100.15206
|
|
|
|
|
If you have a dialog, surely you must know its HWND?
For every message your dialogs message-pump handles, you get a HWND as part of the MSG (so if you handle WM_INITDIALOG, the WPARAM is the HWND of the dialog).
|
|
|
|