|
You'll need to implement your own ModifyString() using InsertString() and DeleteString(). You can modify an item's data using SetItemData() and SetItemDataPtr().
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks for the reply.
I was searching about replacing in a single step.
Thanks
Neha
|
|
|
|
|
You'll need to delete the old string and insert a new one at the same index. There isn't a message for replacing a string in one step.
--Mike--
"Everyone has figured out what 'service pack' really means, so they had to go and change the language. Perhaps this is what Bill was talking about in the 'security is top priority' letter."
-- Daniel Ferguson, 1/31/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
|
The previous posters answered the question but here is one little tip : you can send a WM_SETREDRAW message to the control to tell it NOT to redraw itself while you do the update, followed by another message to enable redraws. If you have a large number of data items in the combo box this will improve the appearance of the update quite a bit.
|
|
|
|
|
It is really a nice tip.Thanks for that.
Neha
|
|
|
|
|
Constructors and destructors will NOT inline in debug mode huh...?
I have viewed my code in the disassembly window and it appears you can't does this, or I am i missing something...?
tried __forceinline but that didn't work either..
Thanx again
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Why do you want to ?
The standard states you are only allowed to *suggest* your compiler inline code, it is always free to ignore you.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Inlining is disabled in debug mode. Makes it much easier to debug these inline routines.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Tis what i was afraid of...
Thanx
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I am working on an MFC SDI application. The Main View is a CListView,with the CDoc holding a list with the root data for the view. The View is initialized to 7 columns and report mode in OnInitialUpdate, and the items are modified in OnUpdate. This works fine so far.
The problem is that when a saved file is loaded, although the data is correctly loaded into place in both CDoc and in the View (OnUpdate does execute), Only the first column displays. When another item is then added to the data, causing another call to OnUpdate, the full list (including the loaded data) displays correctly.
Why would this happen?
Thanks in advance
WJ
|
|
|
|
|
How can I install a driver for a hardware in my VC program?
thanks again!
|
|
|
|
|
You should talk with Service Manager. See OpenSCManager, CreateService. Site http://www.sysinternals.com/ contains number of programs with source code that do this, for example, RegMon.
|
|
|
|
|
I don't want to install a NT service,but a hardware driver!
|
|
|
|
|
The same functions work with drivers. See, for example, dwStartType parameter of CreateService - it's SERVICE_BOOT_START value is used for drivers.
|
|
|
|
|
But How can I install a hardware driver on Win98?
you know,Win98 does not have any service!
|
|
|
|
|
I am trying to develop a prototype that will display text the following way:
Help Me!
e......e
l......M
p.......
.......p
M......l
e......e
!......H
Help Me!
*Note- Dots represent spaces.
Can anyone provide any suggestions? I beleive that a prototype names such as ShowTop, ShowSides and ShowBottom would work, but I just can't figure the logic for sides.
Thanks,
Brad
"If you fell sad about your life, just go to the mall"
|
|
|
|
|
Same suggestion again. You need simply to count the length of the string and put that many spaces between the two characters. I'd do the whole lot in one function, to be honest.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
I am trying to develop a prototype that will display text the following way:
Help Me!
e e
l M
p
p
M l
e e
! H
Help Me!
Can anyone provide any suggestions? I beleive that a prototype names such as ShowTop, ShowSides and ShowBottom would work, but I just can't figure the logic for sides.
Thanks,
Brad
"If you fell sad about your life, just go to the mall"
|
|
|
|
|
You need to do the sides line by line, as that is how the system prints them. Then you need to take the string in question, and set up two variables, one to index front to back, the other to index back to front. Then keep adding to one, subtracting from the other, and outputing lines.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Thanks. The text was actually supposed to be a square box. Opps!
Tx.
Brad
"If you fell sad about your life, just go to the mall"
|
|
|
|
|
does any one know how to read in a file using visual C++?
like if you don't want to input everything from the keyboard
. and you already have your file saved somewhere
thanks
|
|
|
|
|
Yes, you can use IOStreams. Create a ifilestream, and it will read from the file using the same sort of code you've been using to read the keyboard.
ifstream file("c:\file.txt");
if (!file.isgood())
{
cout << "Failed to open file\n";
return;
}
char name[20];
int number = 0;
file >> name >> number;
This assumes you know the format you are reading in ( i.e. what is a string and how long it is, what is an int, etc. ), but I know in your case this is true. Check my previous posts for an easier way to read in a file into an array, but it's no good to you right now, because it uses STL, etc., which I know you're not allowed to do right now.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
i don't think i explained my problem very well. here is the deal:
I want to start debugging my code, so i did as you said i pressed F9
to set my break points, then i pressed F5.
when the program started running it a small DOS window popped on the screen asking me for input.
ok now i cannot enter all the input from the keyboard because it's abig file
;
do you know how to redirect it to go read from that file
instead of the keyboard?
thank you
|
|
|
|
|
My answer remains the same - if you use an ifstream instead of cin, you can leave the rest of your code the same and it will read from the file instead of the keyboard. Isn't that what you want it to do ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|