|
From: Tatsuro M. <mat...@nu...> - 2005-01-27 02:05:09
|
Thnak you for your reply,
>While that may appear to work well, I doubt it's the right way of going
>at it. The data passed to this function are actually type char *, not
>unsigned char *, and casting a pointer from one type to another is
>always a dangerous thing to do, even more so if it's supposed to happen
>this silently, by argument conversion. The correct method would rather
>appear to be a cast of the character being sent to 'unsigned char', as
>it's passed to the Windows API function PostMessage.
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++;
}
}
**************************************************************
According to the windows SDK page, the type of third parameter of PostMessage is UINT
so that casting (unsigned int) is added.
In the Gnuplot Thead in Japan, it was pointed out that
this modification might be effective for people using the iso-8859-* encoding .
Unfortunately we cannot try this, because we do not have a such computer environment.
>
>> 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.
If this BUFFER_SIZE is critical, I will notice this from now
when I use pgnuplot. Thanks!!
Sincerely yours
Tatsuro MATSUOKA.
|