|
From: Hans-Bernhard B. <br...@ph...> - 2005-01-27 08:21:10
|
Tatsuro MATSUOKA wrote:
> Does your suggestion mean that change for the function PostString should be like below?
> ************************************************************
> void PostString(HWND hwnd, char *pc)
> {
> while( *pc ){
> PostMessage( hwnd, WM_CHAR,(unsigned int) ((unsigned char) *pc), 1L );
> /* CRS: should add a check of return code on PostMessage. If 0, the
> message que was full and the message wasn't posted. */
> pc++;
> }
> }
> **************************************************************
No. The secondary cast to (unsigned int) is unnecessary, and
potentially dangerous (because the real parameter type is WPARAM, not
unsigned int). I've checked into a CVS a version that casts to unsigned
char.
> According to the windows SDK page, the type of third parameter of PostMessage is UINT
> so that casting (unsigned int) is added.
If the type were unsigned int, such a cast would be superfluous --- C
silently applies it already.
>>>The buffer size is rather small. (80) I think it should be larger
>>>(eg.512).
>>>
>>>"#define BUFFER_SIZE 512"
>>
>>What do you think would be gained by that? Please note that the size of
>>this buffer may very well be a critical parameter that determines how
>>well pgnuplot works in a somewhat busy Windows environment.
>
> Sometimes I used the script which includes more than 80 character per line.
So what? Did the existing buffer size of 80 cause you any trouble with
those lines?
|