|
|
Hi all,
i have an long string which displayed in Static text control but its not fully displayed,i want to display it in muliline if string is too long and not contain any new line or space.
please help me for this.
thanks in advance.
|
|
|
|
|
The default property of a 'static control' is to support text wrapping. Set the 'No Wrap' property to 'False' if it is set as True by mistake.
|
|
|
|
|
|
Ok, what about resizing the static control at run time, according to the text length ?
|
|
|
|
|
Without spaces text will not wrap in a static control.
You will have to do it yourself by inserting a newline or space at the appropriate place.
The NoWrap property is to tell the static control not to wrap the text even if there is a space or newline character in the text.
I would recommend you use an edit control instead.
Set its Auto HScroll property to False , Read Only to True and Border to False to get a similar visual effect as that of a static control.
Setting Auto HScroll to False will wrap the text even if there is no space or newline characters.
The only difference is that, in a static control you cannot select text and in an edit control you will be able to select text using the mouse.
Also for a static control you can set the text from the property window, while you cannot for an edit control. You will need to use the SetWindowText API to set the text for an edit control.
|
|
|
|
|
To insert newline at apropriate place in string, he can use GetTextMetrics(), and insert '\n' at every (staticCtrlWidth/textMatrics.tmAveCharWidth) position of string. Or any other way?
|
|
|
|
|
That can be done, but the output of a string like "iiiiiiiiiiiiiiWWWWWWWWWWWWWWW" would not be as expected.
|
|
|
|
|
Yes.. average character width makes the problem. Need to track the extend of each character, and apropriately insert the '\n'.
|
|
|
|
|
Hi,
How can I set bitmap or image on CDateTimeCtrl on updown button?
|
|
|
|
|
I am reading id3v2 frame headers from an MP3 file. I am able to read some headers correctly. I read that the frame header TLEN has the total length of the file in milliseconds. The problem is that I have encountered some MP3 files which do not have this frame header "TLEN". I have used Groove Hex editor to check and they are all true. How do I calculate the total length of the file if it does not have the TLEN frame header?
|
|
|
|
|
Me think that the TLEN tag is only informative (option) and not essential. so you will have to find your track lenght somewhere else (probably decode and check the header frame
see this : MPEG Audio Frame Header[^]
M.
Watched code never compiles.
|
|
|
|
|
As Maximilien suggested, to decode and get the duration, render the file using DirectShow, IGraphBuilder::RenderFile(). Obtain IMediaSeeking interface and call GetDuration(). That wil give you the correct duration.
|
|
|
|
|
I am not programming in directshow but I am doing it in C. I want to understand it well so I don't want to use a library.
|
|
|
|
|
well.. if you are programming in C for windows, still you can use directshow, its a part of windows sdk now. Only need to know the usage of COM.
|
|
|
|
|
Hi all,
apologize if this is not right fourm to post this question.
i am really curious to know how we(our program) can mointor the network connections ?
say Zonealram will mointor all the network connection that are getting(incoming/outgoing) how this can be done ? any one if they can share there ideas will be great.
i googled it but i didnt find relavent info so thought of asking experts .
Thanks in advance.
|
|
|
|
|
One thought would be to use the ISensNetwork interface.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
if you are a firewall, you see all network packets that have your IP address as a source or destination, so by watching traffic you can build a list of all other IP addresses of interest.
|
|
|
|
|
Hi Luc, Thanks for your reply.
|
|
|
|
|
Hi All,
I am getting a CString variable which has a value like this
str = "ABCD\tEFGH\tIJKL\tMNOP\nQRST"
I have to process all these tab and newline before sending this CString variable to to 3rd party function.
Example:
This is what I receive:
str = "ABCD\tEFGH\tIJKL\tMNOP\nQRST"
I have send this str like this to the 3rd party function:
str = "ABCD EFGH IJKL MNOP
QRST"
Please give your suggestions.
Thanks,
Joseph
|
|
|
|
|
Can't you use the CString::Replace() method?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I dont want to replace anything. If I find a \t then I have to execute that \t. Please see the example below.
Execute means, if there is a \t then I have to give 5 spaces (tab).
If there is a \n then I have to move the remaining string to the next line.
I have to process this str:
str = "ABCD\tEFGH\tIJKL\tMNOP\nQRST"
like this:
str = "ABCD(TAB)EFGH(TAB)IJKL(TAB)MNOP(NEWLINE)QRST"
There should be 5 spaces in (TAB)
A newline should be in (NEWLINE)
Thanks,
Josef
|
|
|
|
|
Joseph82 wrote: I dont want to replace anything
Yes, that's what you want to do: you want to replace the string "\t" by a tab character and the string "\n" by a newline character. So you have to replace a sequence "\\t" by a sequence "\t" (that's what you have to specify to the replace function, since you have to escape the "\" character).
Executing a '\t' doesn't mean anything, you can't "execute" a tab or a new line.
|
|
|
|
|
Thanks. But how to do it.
How will I get this output in the CString Variable:
str = "ABCD(5spaces)EFGH(5spaces)IJKL(5spaces)MNOP(newline)QRST"
Thanks
Josef
|
|
|
|