I just want to know how to write a c++ function that accepts a string as parameter and return a string back to the main() function.
Rather than passing a string by value, you should generally prefer passing a string by reference to minimise copying.
std::string conv_str_to_upper (std::string const& str)
// Tell upper how long it's going to end up being, so we can allocate that space all at once
// Copy s to upper, but upper-case each character as we go.
std::transform(s.begin(), s.end(), std::back_inserter(upper), (int (*)(int))&std::toupper);
The code for the function is taken from this page[^], which is kind of on your topic.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
I have a simple static splitter with two panes.
I have managed to delete the right pane and having problem repainting it.
While developing I used the attached code for testing and discovered that ShowWindow(SW_HIDE) works after getting the access to parent window and then it does not work after the right pane is deleted and recreated.
That is one part of the puzzle.
The other part is that the new pane can only be repainted when the parent window is resized. Since MoveWindow does resizing too it also repaints the pane.
Seems like awkward way to accomplish repaint.
Any other opinions on the subject are as always appreciated.
Thanks for reading.
Here is the code snippet, Please IGNORE the goofy "-%gt;" characters!
I have given up fixing it!!!
CSplitterWnd * pParent = ( CSplitterWnd * )GetParent();
//pParent->ShowWindow(SW_HIDE); works here
I write a code for the prime numbers of large number in the C programming language and compile the code on the Turbo and it displays two errors
Error1. Constant Expression Required
Error2. Constant Expression Required
As you have seen from the replies, you have not supplied us with any real clues.
The only help you'll get is:
"Hmm, I think the problem is you need to supply a constant expression."
Maybe provide the line the error is from?
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]
Could anyone please tell me how do I get/set the controls of an another dialog box in MFC? (ie getting the values of editbox of dialogB from dialogA). Basically from dialogA, I am opening another model dialog to enter some data in edit box. Now when user press OK, I need those data in my dialogA.
Please help me
For getting the cursor position in a desktop, you will need to run an application on the same desktop.
If that is an option you can have the service communicate with the application using named events and the application can pass the cursor position to the service using shared memory or the file system or the registry.
«_Superman_» I love work. It gives me something to do between weekends.