|
Hello,
I had a question concerning non-visual C++, but I figured I'd ask you guys anyways because you guys know a lot. I am using the string class in C++ (not a char array), and I want to convert it to an uppercase string. I know that char arrays have a toupper() function where you can turn the array, letter by letter, into uppercase values. If I use c_str() and convert my string into a null terminating string. Is it possible though to acces the values of the string, letter by letter?
Thanks a bunch,
Nickone
|
|
|
|
|
You can use operator [] to access individual characters of the standard std::string .
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
sweet!
Thanks a whole bunch. I was trying to use the data() function, but this way is simpler.
|
|
|
|
|
The STL-way of doing this (and here we have a place where STL really shines)would be
std::string s("Mellon");
std::transform(s.begin(), s.end(), s.begin(), toupper);
std::cout << s << std::endl;
std::transform(s.begin(), s.end(), s.begin(), tolower);
std::cout << s << std::endl; You need to include the algorithms header for transform, but otherwise it is pretty straightforward:
Take each element from s.begin() to s.end(), put them to s.begin() (and so on) after you called toupper/tolower with them.
Hope this helped
|
|
|
|
|
You can also use the strupr function but it's not nearly as elegant as the STL solution offered above:
string strData = "Data";
strupr(const_cast<char*>(strData.c_str()));
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Good morning everyone.
I have a question. I wrote a dictionary-based password
filter and have successfully implemented it on my win2000
machine.
However, when I purposely change my password to something
I know will NOT be accepted by the filter, i get this
message ...
<br />
"Your password must be at least 6 characters; cannot <br />
repeat any of yoru previous 3 passwords; must contain <br />
capitals, numerals, or punctuation; and cannot contain <br />
your account or full name. Please type a different <br />
password. Type a password which meets these requirements <br />
in both text boxes."
I'm using CTRL-ALT-DEL to change my password. Is there
any way at all to customize this notification popup so
that I can state my own rules of passwords? Thank-you in
advance for you time
I'm new here, pardon the n00bing
|
|
|
|
|
WMP can only play MPEG2 files if you have installed an external software DVD player. Now i ask, how can WMP utilize that driver that the other program installs?
All help appreciated!
-Rune Svendsen
|
|
|
|
|
It's just a player codec, I think. Works the same as decoders for any other video format (such as divx)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Unfortunately not. I've checked, there's no MPEG2 decoder present as a vcm driver.
|
|
|
|
|
How can I get the hot spot from the cursor?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hello,
I have a SDI program that where I derived two classes from the CRichEditCtrl. In OnCreate inside the view I create the two rich edit controls (one takes up 80% of the view and the other takes up 20% of the view).
The problem that I am having is that if I do a SendMessage() inside of either of the rich edit controls or inside the view the SendMessage isn’t being seen by 9x machines. Everything seems to be working fine on 2k.
For example:
In my View I do a ::SendMessage(m_ctrlRichEdit1.GetSafeHwnd(),EM_SCROLLCARET,0,0);
Or
In CmyRichEdit1 I do a SendMessage(EM_SCROLLCARET,0,0);
The message isn’t being seen on 9x only..
What am I doing wrong?
|
|
|
|
|
As an experiment, see the message to main frame.
AfxGetMainWnd()
GetParent()->GetSafeHwnd()
Kuphryn
|
|
|
|
|
Well the message must be being sent, but possibly isn't being received correctly. Have you tried using Spy++ or WinSpector to watch the messages? Also have you checked the SDK docks for any differences in the Richedit control across Windows platforms.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Your right they are being sent.. Using spy++ I see the send and receive.. but I am unsure what this means.
R EM_SCROLLCARET fSentToEditCtrl:False
Does this "fSentToEditCtrl:False" mean that the message isn't being sent to the edit control even though the edit control sent the message?
|
|
|
|
|
Well I'm not too sure off the top of my head the exact meaning of the Spy info.
In CmyRichEdit1 I do a SendMessage(EM_SCROLLCARET,0,0);
This will send it to itself as you haven't spec'd pView->SendMessage().
Is it both of the SendMessage() cases you are having a problem with or just one?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
when I do a pEdit->SendMessage or a SendMessage or a ::SendMessage the control doesn't do what it's supposed to on 9x, it works perfectly on 2k.. I do a SetSel(-1,-1) to move the cursor to the end of all the text then i do a SendMessage(EM_SCROLLCARET,0,0) to scroll the caret into view.. works great on 2k but it doesnt do anything on 9x the screen sits at the top while the the text piles up at the bottom.. such a weird problem.. I checked all the documentation and it says that every call I am making only requires richedit 1.0 supported in 95 and up.. sooo weird.
|
|
|
|
|
So I assume the caret moves correctly to the end of the control, but EM_SCROLLCARET isn't bringing it into view. Are testing the return values from SetSel() and SendMessage(). Try doing a search on MSDN for EM_SCROLLCARET and see what comes up. Or maybe don't use the RichEdit control.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Thanks for all your help.. I'll do some more research to see if I can't figure this out.
|
|
|
|
|
OK. I have an animation control which has the ACS_TRANSPARENT style. The AVI contains 16 color images (using a magenta background). Teh video displays fine on systems running 32 bit color depth. However, anything less than that is showing the magenta background instead of making it transparent. Does anyone have any suggestions on how to get this to work correctly?
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
How can create a browser, which can preview images as thumbnails.
I have about 50,000 images in a directory, and these images' size are different.
I want a purpose just like the win2K explore.
Thank you very much!!!
If you have any suggestion, mail me: dctao2@ie.cuhk.edu.hk
|
|
|
|
|
Dacheng Tao wrote:
I have about 50,000 images in a directory
Dang! I pity you ! just having 50000 items in a directory is hell enough !
But on the subject, a custom virtual list control ... look around here at code project ... I'm pretty sure someone already did the virtual list control. and if you look more closely, there's what you're looking for.
and if you want to do it yourself, an owner drawn list control is one way to go. and use CDC::StretchBlt to create the thumbnails to a fixed height or width constraint; you can save the thumbnails on disk once they are created for faster access the next time ...
Max.
|
|
|
|
|
Hi,
I create a progress bar in the status bar and it work fine.
But if i create the progress bar within a thread, the application seems lock and i can't close the app.
Anyone have an example how to create a progress bar in the status bar within a thread?
Thanks by advance for ur help.
I't very urgent.
Slts.
|
|
|
|
|
Your progress bar is in the main app and you want to update it from with in the thread? If so you will need to create a function in the main thread to update the progress bar then do a PostMessage from the thread.. When the main app sees the posted message it will update the progress bar for you.
|
|
|
|
|
i use CHtmlView to open a html file by funcion
Navigate2(fileName,0,0);
the html page is loaded properly, but:
if there is a java (1.2, swing) JApplet on the page, the JApplet class can not be loaded or displayed.
for java 1.1 Applet, it is all right.
if lanch the html file directly by IE (just double click the html file), JApplet is displayed well.
my question is: how to use CHtmlView to show JApplet?
(jdk 1.3 is installed in my machine)
thx for any advices.
includeh10
|
|
|
|
|
API functions (look them up):
1) CreateDirectory and RemoveDirectory
2) MoveFile
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|