|
Thats what I figured.... I wanted to avoid having memory overhead, but I guess I will stick with it.
|
|
|
|
|
If you want to avoid memory overhead, they why are you using std::string?
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
|
could we see the body of the function? Maybe you could try something like:
std::sting myfunc() {
....
return std::string(somebuforwhatever);
}
Just a thought
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
Returning std::string by value will cause one or two memory allocations for the contents of buffer - two if your compiler doesn't support so-called 'return value optimization'.
Please note that this is not a problem, unless 'myfunc' is time-critical function. Don't fool yourself into thinking that you need to worry after one or two nanoseconds. Try to save cycles where it really matters.
If you absolutely need to reduce the overhead, you may consider changing the function header to accept std::string reference instead. Instead of returning string, you'll be using operator= at the end of the function.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I want to write a vertical text on my DC , something similar to what Office2K menu bar shows a vertical text when these menubar are docked on left or right edge of the window.
How do I do that ??
Abhishek Narula
"Learn to appreciate others ... World would appreciate you"
|
|
|
|
|
use \n in your string,like:
"H\ne\nl\nl\no"
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Thanks but this would not serve the purpose !
See Lets say I want to write ABC vertically ..
according to your solution output would be
A
B
C
but what I want is thought all the characters would be appearing in different lines but give 90 degree clockwise shift to them , as if you are reading the screen from left edge . did you get this ??
Abhishek Narula
"Learn to appreciate others ... World would appreciate you"
|
|
|
|
|
Abhishek Narula wrote:
did you get this ??
No,I don't get it,Could you put an example here?The output you want to see on screen.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Thats the Irony .. I cant show you that ..
look at the following URL , you ll understand ..
http://www.codeproject.com/staticctrl/rotated_bevel.asp
Abhishek Narula
"Learn to appreciate others ... World would appreciate you"
|
|
|
|
|
So you got your answer,don't you?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hans Bühler's article A bevelline with horizontal and vertical text presents a class that outputs vertical text. Maybe you can investigate its source code to find out how it's done.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Check the nOrientation parameter of CreateFont.
Atul
Don't they know that java is slow.
|
|
|
|
|
Thanks .. I have not tried it as yet . but I think this would surely serve the purpose.
Abhishek Narula
"Learn to appreciate others ... World would appreciate you"
|
|
|
|
|
Hi everybody,
I'd like to display a a small bitmap inside an edit control (in my special case i want to show an greek omega). Does anybody has clues how to solve this ?
Thanks a lot
Mike
|
|
|
|
|
Can't you use a richedit, and a character set that has the Omega ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Have you checked CP?I think there was a CEdit that has bitmap
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I'd start with CEdit::SetMargins to reserve the space for your bitmap. Then, in OnPaint you could draw your bitmap at the margin.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
How can I set the text of a button control vertically like this.
---
| M |
| Y |
| B |
| U |
| T |
---
Is there any style to be set or any custom drawing to be done to get the vertical text settting done?
|
|
|
|
|
Use \n in the caption, so Button for example would be B\nu\nt\nt\no\nn\n1
Serge
|
|
|
|
|
Oh and check multiline property.
|
|
|
|
|
Cool!
I never knew that
Thanks.
Nish
[Signature temporarily down]
|
|
|
|
|
how do you getting timer id what not conflicts with your window base class?
i thought SetTimer() with duplicate id will return 0 but it is not true
do you know any GetTimers(hwnd?)
t!
|
|
|
|
|
The ID needs to be unique only within your CWnd class [assuming you are using this from an MFC CWnd derived class]
In SDK each ID must be unique per HWND
Nish
[Signature temporarily down]
|
|
|
|
|
this i know but how to find there is (in that moment of course only) any already running timer with my id
t!
|
|
|
|