|
In this case read MSDN "Data Conversion Routines" such as atof, atoi, atol...
Vitali
|
|
|
|
|
Well, loop through for every character then. There's no single-function to do it
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Actually there is!
CString::FindOneOf("AllTheCharactersThatAreNotNumbers...");
It's not the best way to do it, but it is possible
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
|
I didn't even thought about UNICODE .
There are 2 proper ways you can solve this problem:
1) Write your own function
2) Just convert the string using atoi (or some other function) and check the return value
If time wouldn't be a problem I would write my own function...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Hi,
I'm writing a tile-based arcade game for Win2000, no Directx, 24-bit screen depth and since I do some paralax scrolling requiring a lot of transparent blits, I have performance problems. As I think 256 colours would be enough for my application, I'd like to know if it is a good idea to create only 8-bit back buffer in memory and then blit it into 24-bit windows screen. Or, maybe have 24-bit back buffer and blit in 8-bit images. Would this speed-up my program?
Koxin
|
|
|
|
|
You may find this useful function in my CSkinProgress component at : http://www.codeproject.com/miscctrl/CSkinProgress.asp
Output bitmap : a bitmap created but NOT initalized
Input bitmap : your 8-bits bitmap
CDC : None to convert in the current DC, or a 24-bits compatible DC
The best is to include the CSkinProgress in your project (you might use it for various purposes ), then create a CSkinProgress object and use its CSkinProgress::ConvBitmap(...) function for your own purposes !
Kochise
In Cod we trust !
|
|
|
|
|
How do I convert a binary file to text file..?
Is there any API or any method by which I can achieve this...
Pratz
|
|
|
|
|
Hi,
some questions:
Is it realy a binary file? (you can't read anything if you view this file with e.g. Notepad). It is also possible, that you can read something with notepad, e.g. if you open a Worddocument as text file.
What type of binary file is it?
If it is realy a binary file, than you must know the coding rules (the same for decoding) for this type of file.
Regards
Frank
|
|
|
|
|
I'm not sure what you want to do, but anyway the difference between binary and text files is that text files are actually subgroup of binary files. That means that bytes (characters) in text files have only certain values specified in ASCII table (e.g. 'a' has a value of 97, 'b' 98, ...) while bytes in binary files can have any possible values (0-255).
Thus if you want to display a binary file in a text editor all you need to do is replace all non-ASCII characters with ASCII characters. Then the text editor will not find any character it can't deal with in the file and will consider it to be a text file.
Koxin
|
|
|
|
|
Sorry, it may be a old question, but i couldn't found it !
My mean is very simple, i want my program can hook Right click event and get the text under mouse pointer .
Any one can help me ?
|
|
|
|
|
Are you talking about a window in your own program, or any window of any program?
The second is almost impossible, because the user could be right clicking over anything, not just text, and even if he did, you would have no way of knowing it.
If you want to hook into system wide mouse events, I've heard of that being done, how you would find out what window owns that mouse event or has text, I'm not sure.
|
|
|
|
|
Sorry !
My mean is anywhere, any program ( IE, Office,....),
i've see some program can do that , ah , i'm a vietnamese, we have a good English- Vn e-dictionary is
" Just Click'n'See" that can get a English word from screen and display it's Vetnamese mean ! It's so cool !
So i'm want to know the beside tech of it !
|
|
|
|
|
Even though MartinOrtriz replied to your post, you can read the answer in the FAQ page here [^].
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
____________
4.14: How do I retrieve the text that the mouse cursor is pointing at? (top)
There is no built-in way to do this. Once the text is on the screen, it is no longer readable as a character string, only as a bitmap. You'll need OCR (optical character recognition) software to transform the bitmap back into a string of characters.
______________
Ofcource, there is no built-in way, but it's not a mission possible, try download this program and feel it
Just Click'n'See
thank !
|
|
|
|
|
I know what you mean because I have a dictionary that works by clicking on the words. The thing is that in those dictionaries the programmers know where the words are located. To tell you the truth I don't know what kind of algorithms they use, but trying to get any words that appear on any window doesn't seem to be simple. You are looking at pixels not an edit box. And of course it is not mission impossible, and you can go ahead and try it but it might turn into mission un-feasible.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
No, no, no !
Don't simple like that, why u don't try
Just Click'n'See
one time !
that all my mean !
The core of it's solution is :
- Hooking mouse or Keyboard
- Get position
- Invalid this screen and windows will re-paint it
- Hooking output stream and get what u want
But what i need is a sample source code
But, thank for your comments
|
|
|
|
|
Sorry but I cannot understand the program because it is in Vietnamese. My reply was intended to tell you that what you are after is not easy. I really cannot help you with your brainstorming because I have never attempted to read text from the screen and I don't think I will in the near future (I usually don't try things unless I have to). With that said and done let me remind you that Einstein (I think) said (not his exact words): "There is something that every man on this planet knows that it cannot be done. Here comes a person that doesn't know that and he solves the problem." Let's hope you will be that person.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Hi,
I'd also like to know a solution to this problem. I'm not proficient in windows programming, but I suggest this:
- get the handle of the active window
- send the window doubleclick message (this should select the word the mouse is pointing at)
- send a message that copies the selection into clipboard
- read the word from clipboard
maybe that once the word is selected it's also possible to retrive it by sending the window some getselection message or something like that.
what do you think?
Koxin
p.s. if you find a solution to this problem please let me know
|
|
|
|
|
here a example screen shot
Hi, Koxin, i've got a same idea in FAQ and have a example in MSDN but not easy ! And i'm sure have a solution didn't use Clipboard . Any one can suggest another idea ?
Coding for lv,lv & di
|
|
|
|
|
I am having trouble finding a direct way of setting a bitmap as the background of a CFormView. I've done this before using a CDialog class, but as I'm finding, the CFormView isn't quite the same. The bitmap is already defined in the resource file, not loaded at runtime. Thank you for any help anybody can give!! ;)
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
This should be done in the OnEraseBkgnd() handler.
In your view class .h file add:
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
In your view class .cpp file add:
ON_WM_ERASEBKGND()
Then you can add this function:
BOOL CYourFormView::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Hi Douglas,
Check your email.
I hope that posted sources will solve your problem.
Vitali
|
|
|
|
|
I would like to use JTC.h in VC++ 7.0.
Can I use that? if yes, please tell me how.
I mean how I can link that to my project.
thanks!
|
|
|
|
|
can anyone tell me the proper way to disable and enable them within a dialog i know ive posted this thread 2 times already but neither asnwer worked
thanks for any help
|
|
|
|