|
oops, wrong answer, Frederick! See the other posts!
|
|
|
|
|
Besides the first 31 characters containing control and unprintable characters, I would say the problem would be that 255 would never be reached. char can contain values -128 through to 127. As soon as the eighth bit was filled it would become a negative number.
So how did I go?
Am I as good as I tell my wife I am or what !!!
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Even with unsigned char, you would have trouble because the loop condition is for i <= 255, so even an unsigned char would roll over to 0 without terminating the loop.
|
|
|
|
|
Not true. unsigned char can hold a value of 255. Formula is 2n -1 (where n is the number of bits in the data type)for unsigned values. In this case it is 28 - 1 = 255.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Of course unsigned char can hold 255, but to terminate this loop you need 256, look again on condition:
ch<=255;
Do you feel that you still good?
|
|
|
|
|
Bingo! I'd say your wife is lucky. On the other hand, you could be a nerd...
|
|
|
|
|
Dear All
How efficient is this editor to build a customized setup file making use of the windows installer.
regards
Sankar
|
|
|
|
|
Orca is not the tool to use for creating Windows Installer packages. You need something like Installshiled or Wise. Orca can be used to view and modify an existing package though.
|
|
|
|
|
Has anyone figured out how Microsoft (MFC) gets away with storing a pointer to a function with the thiscall calling convention (meaning it pushes an implicit this before its normal parameters)?
|
|
|
|
|
There's nothing magical about it, if I understand your question. When you call the function thru the function pointer, you still need an object to provide the this pointer.
CWnd wnd = ....;
BOOL (CWnd::*pFunc)(int) = CWnd::ShowWindow;
(wnd.*pFunc)( SW_SHOW ); In that example, wnd provides this .
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
That did the trick. It makes sense too...I was just under the impression you couldn't declare a function pointer with the CWnd:: attached to it. Probably remnants of someone telling me "Oh you want to do what?? you cant do that!" Thanks a bunch
|
|
|
|
|
Got two questions regarding wizard/CPropertySheetx:
1. is there a way to hide Help button?
2. how to make the watermark stayed at left
side of the dialog box instead of filling the
entire area? thanks.
p.c.
|
|
|
|
|
Yes, I think the ID of the button is IDHELP, or something similar. So GetDlgItem, and call ShowWindow(SW_HIDE).
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
In the PROPSHEETHEADER, remove PSH_HASHELP from the dwFlags member. Then in each PROPSHEETPAGE, remove PSP_HASHELP from dwFlags. Those flags are turned on by default in MFC wizards.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
Does anybody have a class to convert a string e.g "1230" to readable format e.g. "thousand two hundred thirty" .
Or is there an API for this ?
Orcun Colak
orcuncolak@yahoo.com
|
|
|
|
|
This is a common homework question so I'm sure there are answers on the web ( assuming you don't need it for homework, if you do, then I'd suggest doing your own homework is a good way to leave Uni with knowledge as well as a certificate and surviving in the job market ).
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
No it is not homework. maybe it is my fault that i did not explain it very good.
I am searching something like this because i was wondering what other approaches are taken by other people. I want to have a generic class that i can use for many different languages besides english. Not every language has the same "conversion logic" For example "1000" which is "one thousand" is only "thousand" without one in some languages or "11" which is "eleven" is "ten one" is some languages. i am not sure if i could explain it ??
i was in search of something which can be converted to another language easily covering all the exceptions. am i asking too much ? anyway thanks for your response.
|
|
|
|
|
How do I set the color (background) for a dialog. I tried SetDialogBkColor, and it didn't have any effect.
Richard
|
|
|
|
|
Handle WM_ERASEBKGND and fill in the client area with whatever color you want.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
Hello
I would like to map a file to memory and treat it as a string (specifically, I want to use strtok); however, I need to append the '\0' end of string marker for most C string functions to work. How can I gain access to the first byte _after the end of the file_ and put the 0 there? (I tried it and it worked but I'm not sure if it always will?) Obviously I can change the last byte of the file but that's not very elegant...
Any hints appreciated. Thanks!
Razvan
|
|
|
|
|
I saw that some (new) function definitions in Winuser.h are "guarded" by:
#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
...
#endif
I've also noticed that afx.h sets _WIN32_WINDOWS to 0x0500. Can anybody tell me more about these macros ?
I vote pro drink
|
|
|
|
|
_WIN32_WINDOWS tells what version of OS you are running. 0x0500 means Windows 2000.
If you want to target systems such as NT4 you would set _WIN32_WINNT = 0x0400.
You may also need to set _WIN32_IE appropriately for some IE features, like Active Desktop.
Some features are not available on lower systems so they are placed in the "guarded" section to prevent their use.
|
|
|
|
|
Hi,
Is there any way to print a window and its contents onto the printer just like it looks on the screen without capturing its bitmap? What does WM_PRINT do?
Krishnan
|
|
|
|
|
Hi,
Is there any way to print a window and its contents onto the printer just like it looks on the screen without capturing its bitmap? What does WM_PRINT do?
Krishnan
|
|
|
|
|
Hi,
Is there any way to print a window and its contents onto the printer just like it looks on the screen without capturing its bitmap? What does WM_PRINT do?
Krishnan
|
|
|
|