Re: PostMessage() Error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks so much for all of your help.

Here is the problem with Microsoft GUI application. It doesn't take the
standard input from pipe.

the problem is summarized as the following:

int main()
{
.....
while (fgets(psBuffer, BUFFER_SIZE, stdin) != NULL) {
PostString(hwndText, psBuffer);
}
.....}


void
PostString(HWND hwnd, char *pc)
{
while(*pc) {
PostMessage(hwnd, WM_CHAR, (unsigned char) *pc, 1L);
pc++;
}
}

it get the problem of ERROR_NOT_ENOUGH_QUOTA for the function of
PostMessage() after processing 4k of stdin piped data ( I have 14K of
stdin data to process)

I have been thinking use string instead of char to resolve the problem.
Maybe it is not helpful. Also, tried WaitForInputIdle() to slow down PostMessage() after 1000 characters, it doesn't help.

Any suggestions?
.



Relevant Pages

  • Re: pipe problem
    ... PostString(HWND hwnd, char *pc) ... PostMessage(hwnd, WM_CHAR, (unsigned char) *pc, 1L); ... processing 4k of stdin piped data ...
    (microsoft.public.vc.language)
  • Re: Curses???
    ... Do I use ioctl() to set the c_lflag. ... have it open (STDIN) and the following code may be more useful to work ... int inhibitStdinInBuffering(void) ... ioctl(STDIN, TCGETA, (char *)&originalIoSettings); ...
    (comp.os.lynx)
  • Re: Curses???
    ... Do I use ioctl() to set the c_lflag. ... have it open (STDIN) and the following code may be more useful to work ... int inhibitStdinInBuffering(void) ... ioctl(STDIN, TCGETA, (char *)&originalIoSettings); ...
    (comp.os.lynx)
  • Re: alloca
    ... ptr = fgets, SIZE, stdin); ... {char buffer; ... If the implementation uses a stack for allocaand for local variables, then it seems stack overflow is equally likely. ...
    (comp.lang.c)
  • Re: different behavior of shell and embedded interpreter
    ... main (int argc, char *argv) ... Tcl_Interp *interp; ... int code, temp; ... while, stdin)) ...
    (comp.lang.tcl)