|
thank u for ur suggestions,
so u think i've to use a separated thread for this purpose?
is it the best way? what if i want to avoid multi-threading problems by keeping it a single-thread app?
|
|
|
|
|
I think multi-threaded model is best practice for these case.
Another approach is message processing like windows 3.1 ages programming style.
Like this;
bool f_stop = false;
void CMyDialog::OnCancel() {
::f_stop = true;
}
void Yield() {
MSG msg;
for (int j = 0; j < 100; j++) {
if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) {
DispatchMessage(&msg);
}
}
}
void calc() {
for () {
for () {
for() {
Yield();
if (f_stop) goto exit_all_loop;
}
}
}
exit_all_loop:
}
Above is rather old style but suitable some situations; (hate multi-threading or so.)
But consider this code makes calc() so slower, so I think multi-threading is better.
|
|
|
|
|
i think it's better to comply with using a thread for this purpose. it's better not to alter the ordinary msg loop functionality. it does additional works like TranslateMessage, calling application's OnIdle, etc. which i don't intend to implement separately nor to lose what they do.
thank u very much
|
|
|
|
|
|
See here[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi,
What i need is some what different from what you send me. I need to replace the [+/-] buttons of tree control that needs custom drawing of control. One big problem with is my working with pure win32 not MFC. What I need, it is at VividTree - A Colorful and Picturesque Owner Drawn CTreeCtrl Class[^]. but it is in MFC i need to convert this in wn32 code. But i am facing problem while BitBlt of arrow buttons in DrawItem( ) of that code.
Please Help.
|
|
|
|
|
Hi ..
How to segment the each and every characters from the word.
Consider for an example:
WORD - Segmented Characters
Visualc++ ------ > V|i|s|u|a|l|c|+|+|
After Segmentation
Could any one how to segment eace character
|
|
|
|
|
What do you mean by "segmenting" ? This word is stored in a char array ? If yes, then simply access each character using the [] operator.
I don't really understand your problem, could you elaborate a bit ?
|
|
|
|
|
Actually i have to segment the characters which is in the form of image.
EX:
An bitmap image with visual c++ text on it..
we have to split the characeter from the bitmap image
|
|
|
|
|
Do you really mean this (I can't believe)?
#include <stdio.h>
#include <string.h>
void main()
{
unsigned int i;
char word[] ="VisualC++";
for (i = 0; i<strlen(word); i++)
{
printf("%c|", word[i]);
}
printf("\n");
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
no not this...
do u know captcha ?
we need to Extract text from the bitmap image..
then we need to find each character
|
|
|
|
|
Image processing
After Extracting the text .then We need to find identify each character on bitmap image
My question is how to segment each character while extracting
|
|
|
|
|
You should scan lines of bitmap image.
If image is very separated by rectangles its a bit easiyer to cut cells.
And if each rectangle size is fixed, its easy programing.
But each character donsent hava ordinary rectangle regions its hard to cut from.
You must recognize each region of character at first and cut region, normalize and reconize as character next.
... it is very hard to program for me ...
|
|
|
|
|
Are you writing a bot?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ya ofcourse..
Could u help me out
|
|
|
|
|
hi guys,do you know how can we print the unicode character using the unicode number to a text file?
for example,i read the unicode number from a text file & put in on a char array,for example:
char uniNumber[4];
uniNumber[0] = charInput[0] // charInput[0] == 6
uniNumber[1] = charInput[1] // charInput[0] == a
uniNumber[2] = charInput[2] // charInput[0] == 0
uniNumber[3] = charInput[3] // charInput[0] == 7
how can we print the unicode number to this character(樇) in text file?
thank you guys.
|
|
|
|
|
If I understand correctly and your UNICODE character code is 0x70a6 , you may try this
unsigned short us = (uniNumber[3] << 12) | (uniNumber[2] << 8) | (uniNumber[1] << 4) | uniNumber[0];
fwrite((char*) &us, sizeof (us), 1 , fp);
This is correct as far uniNumber[1] = 0x0a; , on the other hand, if uniNumber[1] = 'a'; then you need a bit more manipulation (the same applies, of course, to every uniNumber array item).
Moreover you need to write the proper BOM [^] at the very beginning of the file.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Can anyone please tell me some package for handling Digital certificates.....
I want to extract the public key or private key from the digital certificate and use it for encryption and digital signature...
The code is in C programming
|
|
|
|
|
Hi guys
in CEdit control has text "The New (cursor at) Text"
when click 'enter' i want to implement text in CEdit is
"The New
Text
"
i don't know how to capture the 'enter' and to override the event
thank you for reply
|
|
|
|
|
I believe all you need is to make your edit box multiline? How do you create the edit box? If it is on a dialog you load from resource, select the edit box in resource editor and make sure the property "multiline" is set to TRUE for it. If you create the edit box from code, then add the ES_MULTILINE flag to its style.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
thank you for reply
I add a edit box on a dialog
i do follow you say to change the property 'multiline' to true;
but when i click 'enter' button text in edit box doest't chagne line
'cursor' you know i want to split the text by cursor right of cursor text
to new line left is not change;
thanks
|
|
|
|
|
I'm not sure i completely understand your problem. What do you mean by "click enter button", you mean, you have a button labeled "Enter" on your dialog and you click that with the mouse and want a new line inserted into your edit box?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
first i very sorry for my poor english
click enter button is means click KeyBoard's enter button,so my program
must to capture the KeyBoard input what key
i do not know how to implement
thanks
|
|
|
|
|
I guess, you need to handle PreTranslateMessage[^]. Check for message WM_KEYDOWN[^] and parameter VK_RETURN . Once you got this, make sure your control has focus, so that you can make sure enter key is clicked from that control.
|
|
|
|
|
jeansea wrote: but when i click 'enter' button text in edit box doest't chagne line
Did you also remember to add the ES_WANTRETURN style? Otherwise, the ENTER key will cause the dialog to close.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|