I am trying to use this control in a toolbar. For the most part the code works. However, I am running into this odd problem that I am getting partial text back when I call GetText.
The app requires that when I click a different button in the toolbar, I check the combo box and retrieve the text from it for processing. That is when this bug surfaces. The last character is getting truncated. If I retrieve the text in response to the Enter key handler for the combo box, I get the full text using the same GetText call.
Here is the code...most all of it is lifted from the samples.
Yes, I finally got frustrated enough to think up alternatives. I had already coded to find the CMFCToolbarComboBoxButton object (Code from MSDN actually), so now I went ahead and code along the following lines:
Using the Edit Control seems to have solved the problem for me. At the MFCToolbarComboBoxButton level, there is no option for a fix that I have found. Perhaps subclassing the control and intercepting the GetText() call may work, but I have not tried it.
In our application we have DLL that is used to write information to Event
Log. Problem is when I need uninstall/upgrade our application this DLL is
often locked after our application is shut down and it requires computer reboot which is undesirable.
For what it's worth - our application is a service. All other .DLL/.EXE files are successfully deleted by uninstall after service is stopped. Or they can be deleted manually if service is stopped.
There is a way to forcibly close handles - because Process Explorer can do it.
However, in this situation, you should use MoveFileEx[^] with the MOVEFILE_DELAY_UNTIL_REBOOT flag and a NULL destination filename and Windows will perform the file deletion at the next boot time, before any applications have started to lock the file.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Hmm guys,is it possible to display number1+ number2+number3?
Eg,if a program prompts a user to input 3 numbers,N1,N2 and N3,is it possible for the program to display N1+N2+N3?As far as i know,we can use a while loop to straight away give us the final answer for N1+N2+N3.
To make it clear,if i input 5 as N1,10 as N2 and 15 as N3,can we make the program display
"total=5+10+15=30" instead of "total=30"?
From here we can see that the compiler adds up all the 5 numbers.My question is how should i put it so it would display" total: N1+N2+N3+N4+N5=XX "instead of adding all the numbers up then display "total:XX"
See my last answer to your previous question. You really need to study the C language further in order to understand some of the answers given here. Most of the people providing answers here are assuming that you have a basic knowledge of all C language constructs; your supplementary questions make it clear that you have not.
This is not a criticism of you (we all had to start somewhere), rather advice on how to get to the place you want to be.
So if he's any good at his job he has taught you all you need to know to solve the problem you have been given. Maybe you need to read through your notes again, to refresh your memory of the bits you have been studying. As my mentor 'Big John' was fond of repeating ad nauseam: "practice, practice, practice".