f



WinSetCp() falls over after a certain number of times

Lately I've been writing some PM programs that require switching between
character sets via the codepage.

One example is http://www.cs-club.org/~alex/programming/os2/#dbcsmap -
which requires me to switch codepages depending on what character set the
user wants.  I'm also working on another program which requires only
codepage 943.

The problem I see is that after switching the PM codepage using
WinSetCp(hmq) a certain number of times (within the same or different
programs, it makes no difference), it will stop working -- for all
applications!  The characters being displayed turn into meaningless
garbage.  Only rebooting will restore normal functionality.

I don't know exactly what the number is, it might be 50 or 100 times (or
it might vary), but it eventually happens, without fail.  

Could I be doing something wrong?  Is there some resource that I am
neglecting to free up, that PM is exhausting as a result?  Or is
WinSetCp simply flaky (and yet, there are applications out there that
seem to handle multiple codepages without trouble)?

I've taken a look at Ken Borgendale's sample code, but the limited parts
that I'm capable of reading seem to be using WinSetCp in the same way as
me.  (The ULS API only seems to be used in order to query glyph and
locale information, or convert text from one codepage to another, which
doesn't seem to help me -- I still have to use WinSetCp to switch
codepages, right?)

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
5/9/2006 2:58:02 PM
comp.os.os2.programmer.misc 1326 articles. 0 followers. Post Follow

66 Replies
489 Views

Similar Articles

[PageSpeed] 19

On Tue, 9 May 2006 14:58:02 UTC, Alex Taylor <mail.me@reply.to.address> wrote:

> The problem I see is that after switching the PM codepage using
> WinSetCp(hmq) a certain number of times (within the same or different
> programs, it makes no difference), it will stop working -- for all
> applications!  The characters being displayed turn into meaningless
> garbage.  Only rebooting will restore normal functionality.
> 
> I don't know exactly what the number is, it might be 50 or 100 times (or
> it might vary), but it eventually happens, without fail.  
> 
> Could I be doing something wrong?  Is there some resource that I am
> neglecting to free up, that PM is exhausting as a result?  Or is
> WinSetCp simply flaky (and yet, there are applications out there that
> seem to handle multiple codepages without trouble)?

If you want to see if another program produces the same result, get
cppal030.zip.  It will let you change an app's PM and/or system codepage
to any that are available.  The package also includes the source code.

Suggestion:  if you think you'll have to change CPs 50-100 times, open
two copies of the util, each set to a different CP.  Since CPPal works
via d&d, it shouldn't be too painful if you position its windows adjacent
to or on top of your target.


-- 
== == almost usable email address:  rich AT e-vertise.com == ==
___________________________________________________________________
                |
                |          Remote Workplace Server v0.70
Rich Walsh      |      interact with the WPS from any program
Ft Myers, FL    |       http://e-vertise.com/rws/rws070.zip
___________________________________________________________________
0
Rich
5/10/2006 5:43:51 AM
On Wed, 10 May 2006 05:43:51 UTC, "Rich Walsh" <spamyourself@127.0.0.1> wrote:

> > The problem I see is that after switching the PM codepage using
> > WinSetCp(hmq) a certain number of times (within the same or different
> > programs, it makes no difference), it will stop working -- for all
> > applications!  The characters being displayed turn into meaningless
> > garbage.  Only rebooting will restore normal functionality.
> 
> If you want to see if another program produces the same result, get
> cppal030.zip.  It will let you change an app's PM and/or system codepage
> to any that are available.  The package also includes the source code.
> 
> Suggestion:  if you think you'll have to change CPs 50-100 times, open
> two copies of the util, each set to a different CP.  Since CPPal works
> via d&d, it shouldn't be too painful if you position its windows adjacent
> to or on top of your target.

Well, I've tried for a while and haven't gotten CPPal to cause the problem
yet...

All my programs definely do it, though.  All I do is put one line calling
WinSetCp() in the initialization code.  Is there something else that has
to be done?

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
5/13/2006 5:33:07 PM
I've nailed down a concrete test case for this weird problem that has been
plagueing me:
    http://www.cs-club.org/~alex/os2/cptest1.zip

Try running and exiting CPTEST.EXE 25 times.  It works properly 24 times.
Starting with the 25th time, the codepage change no longer works properly,
and the text turns into garbage.  It won't work again until a reboot.


This simple program displays two static text strings -- one in basic ASCII
characters, and one in Japanese characters.  When the program starts, it
issues a WinSetCp() to codepage 943 (in WM_INITDLG processing).

The program allows you to toggle back and forth between codepages 850 and
943, but this isn't necessary to reproduce the problem.

Whenever it changes the codepage, the program resets the text control font
to "10.Times New Roman MT 30" using WinSetPresParam().

The zipfile includes the source code.


The odd thing is that exiting and restarting the program seems to be a
crucial element in triggering the error.  Simply switching the codepage
back and forth any number of times does not always trigger the error,
unless the program has already been run repeatedly since the system
started.  

I'd appreciate any suggestions.  I'm sure I must be doing something
wrong... is there some cleanup that I'm neglecting to do before exiting?

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/15/2006 2:38:01 PM
 > Whenever it changes the codepage, the program resets the
 > text control font to "10.Times New Roman MT 30" using
 > WinSetPresParam().

What happens, if possible, if you don't reset the font each time?

The reason I'm asking this is because I cannot try it myself now,
and Netscape/2 sometimes shows a problem which sounds to be about
equal to me, but (by the looks of it) with another, bigger and fat
font. Hence me mentioning the relation with setting the fonts too,
given the garbage you mentioned (with Netscape/2 "veil" may start
to look like "vel", "viel", "v ei l", "v iel", and so on). HTH...

BTW, IIRC whenever this happens Netscape/2 becomes lightning fast
w.r.t. screen-I/O, as if my PIII CPU has been replaced by a PVII
CPU.



---
0
ML
6/15/2006 3:35:29 PM
 > What happens, if possible, if you don't reset the font each time?

Or, FWIW, don't set it, i.e. using the default font?



---
0
ML
6/15/2006 3:37:37 PM
In <44917077$0$60333$bb4e3ad8@newscene.com>, on 06/15/2006
   at 09:38 AM, Alex Taylor <mail.me@reply.to.address> said:

>Try running and exiting CPTEST.EXE 25 times.  It works properly 24 times.
>Starting with the 25th time, the codepage change no longer works
>properly, and the text turns into garbage.  It won't work again until a
>reboot.

Before guessing, you really should let the system help you and add some
error checking.  You might find that the error code tells you exactly why
PM (I suspect) is unhappy.

Change the code from

  WIn...()

to

  if (!Win...) {
    err = WinGetLastError(NULLHANDLE);
    fprintf(stderr, "Win... failed with error 0x%x\n", err);
  }

Run your code as

  cptest 2>stderr.out

For more comprehensive error reporting, you can adapt the appended code
which uses WinGetError().

Regards,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------
//== Win_Error: report Win...() error ===

VOID Win_Error(HWND hwndErr, HWND hwndOwner, PSZ pszFileName, ULONG ulLineNo, CHAR *pszFmt,...)
{
  PERRINFO pErrInfoBlk;		/* Pointer to ERRINFO structure filled
				   by WinGetErrorInfo */
  PSZ pszOffset;		/* Pointer to current error message returned
				   by WinGetErrorInfo */
  CHAR szMsg[4096];
  PSZ psz;
  HAB hab;
  va_list va;

  if (hwndErr == NULLHANDLE)
    hab = (HAB)0;
  else
    hab = WinQueryAnchorBlock(hwndErr);

  // Format callers message
  va_start(va, pszFmt);
  vsprintf(szMsg, pszFmt, va);
  va_end(va);

  // Append file name and line number
  sprintf(szMsg + strlen(szMsg),
	  GetPString(IDS_GENERR1TEXT),
	  pszFileName, ulLineNo, "  ");

  // Get last PM error for the current thread
  pErrInfoBlk = WinGetErrorInfo(hab);
  // fixme to report
  if (pErrInfoBlk != NULL)
  {
    if (!hwndOwner)
      hwndOwner = HWND_DESKTOP;
    /* Find message offset in array of message offsets
       Assume 1 message - fixme?
     */
    pszOffset = ((PSZ) pErrInfoBlk) + pErrInfoBlk -> offaoffszMsg;
    /* Address error message in array of messages and
       append error message to source code linenumber
     */
    psz = szMsg + strlen(szMsg);
    sprintf(psz, "#0x%04x  \"", ERRORIDERROR(pErrInfoBlk -> idError));
    psz += strlen(psz);
    strcpy(psz, ((PSZ)pErrInfoBlk) + *(PSHORT)pszOffset);
    psz += strlen(psz);
    strcpy(psz, "\"");
    WinFreeErrorInfo(pErrInfoBlk);	// Free resource segment

    showMsg(MB_ENTER | MB_ICONEXCLAMATION,
	    hwndOwner,
	    GetPString(IDS_GENERR2TEXT),	// Titlebar message
	    szMsg);			// Formatted message
  }

} // Win_Error


//=== showMsg: report misc error ===

static APIRET showMsg(ULONG mb_type, HWND hwnd, CHAR *pszTitle, CHAR *pszMsg)
{
  if ((mb_type & (MB_YESNO | MB_YESNOCANCEL)) == 0)
  {
    fputs(pszMsg, stderr);
    fputc('\n', stderr);
    fflush(stderr);
  }

  if (!hwnd)
    hwnd = HWND_DESKTOP;

  return WinMessageBox(HWND_DESKTOP,	// Parent
		       hwnd,		// Owner
		       pszMsg,
		       pszTitle,
		       0,		// help id
		       mb_type | MB_MOVEABLE);
} // showMsg

0
Steven
6/15/2006 4:35:20 PM
On Thu, 15 Jun 2006 16:35:20 UTC, Steven Levine <steve53@earthlink.bogus.net> wrote:

> >Try running and exiting CPTEST.EXE 25 times.  It works properly 24 times.
> >Starting with the 25th time, the codepage change no longer works
> >properly, and the text turns into garbage.  It won't work again until a
> >reboot.
> 
> Before guessing, you really should let the system help you and add some
> error checking.  You might find that the error code tells you exactly why
> PM (I suspect) is unhappy.

I do actually do this in my normal program(s) that I encounter the problem
in.  It's easy enough to copy the code I use into this program:

    CHAR szError[100];
    if ( !ulRc ) {
        ulErr = WinGetLastError( pGlobal->hab );
        sprintf( szError, "Unable to set PM codepage:\n\nError \
                           Severity:\t0x%02X\nError code:\t0x%02X",
                          ERRORIDSEV( ulErr ), ERRORIDERROR( ulErr ));
        ErrorPopup( szError );
    }


As a matter of fact, though, the sample program does print the return code 
from WinSetCp in the status line, and it's always 1 (TRUE), even when the 
problem appears.



-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/16/2006 12:12:20 AM
In <EzI08Q3LwTQm-pn2-d1h5zGYvgKmw@localhost>, on 06/15/2006
   at 07:12 PM, "Alex Taylor" <mail.me@reply.to.address> said:

>I do actually do this in my normal program(s) that I encounter the
>problem in.

Sorry.  My mind reading failed me. :-)


>As a matter of fact, though, the sample program does print the return
>code  from WinSetCp in the status line, and it's always 1 (TRUE), even
>when the  problem appears.

See above. :-)

IAC, since it appears to be a reproducible defect.  I would recommend you
package up the testcase and let Chuck submit a PMR.

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/16/2006 2:47:20 AM
On Fri, 16 Jun 2006 02:47:20 GMT, Steven Levine <steve53@earthlink.bogus.net> wrote:
>>I do actually do this in my normal program(s) that I encounter the
>>problem in.
>
> Sorry.  My mind reading failed me. :-)

Hence the "actually".  :)


>>As a matter of fact, though, the sample program does print the return
>>code  from WinSetCp in the status line, and it's always 1 (TRUE), even
>>when the  problem appears.
>
> See above. :-)
>
> IAC, since it appears to be a reproducible defect.  I would recommend you
> package up the testcase and let Chuck submit a PMR.

I want to make sure it _is_ a defect first.  I mean, plenty of other
programs must make use of different codepages, so why has nobody else
ever reported a similar problem (that I can find)?  

So I can't shake the suspicion that I'm doing something dumb, but I can't
imagine what that may be...

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/16/2006 2:24:03 PM
On 15 Jun 2006 15:37:37 GMT, ML <spamgate@hotmai1.com> wrote:
> > What happens, if possible, if you don't reset the font each time?

Well, if I don't reset the font, the codepage change doesn't show up
visibly.

That means I can't check for the error without dragging a font from the
Font Palette.  I tried it, and the same error seems to occur.


> Or, FWIW, don't set it, i.e. using the default font?

Interestingly, it went a lot longer without triggering the error, but it
still (eventually) occured.  I think it was about 50 times this way.
(Again, dragging Times New Roman MT 30 from the Font Palette manually
onto the one text field, instead of setting it programatically.)


I wonder if it has something to do with using dialog controls, instead of
creating the window myself and using WM_PAINT...


-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/16/2006 2:34:01 PM
In <4492bebd$0$60371$bb4e3ad8@newscene.com>, on 06/16/2006
   at 09:24 AM, Alex Taylor <mail.me@reply.to.address> said:

>I want to make sure it _is_ a defect first.  I mean, plenty of other
>programs must make use of different codepages, so why has nobody else
>ever reported a similar problem (that I can find)?  

Generally, one does not change code pages all that often in an
application.

>So I can't shake the suspicion that I'm doing something dumb, but I can't
>imagine what that may be...

I don't see anything obvious and os2trace shows nothing out of the
ordinary.  However, I did not attempt to do any tracing inside the os/2
DLLs.

The only thing that is unusual about your code is the use of WinDefDlgProc
in the WM_INITDLG logic.  I would expect to see WinPostMsg or, worst case,
WinSendMsg.  What is your reason for using WinDefDlgProc?

Regards,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/16/2006 4:14:48 PM
On Fri, 16 Jun 2006 14:24:03 UTC, Alex Taylor <mail.me@reply.to.address> wrote:

> So I can't shake the suspicion that I'm doing something dumb, but I can't
> imagine what that may be...

I don't think so...  I opened e.exe, changed its CP to 950, then closed it
at least 30 times.  At some point (and I can't say when since I was trying
other things as well), I tried opening e's font dialog.  It took a long
time to appear, and when it did, most controls were missing their text, and
the font listbox was filled with squares where there should have been font
names.  


-- 
== == almost usable email address:  rich AT e-vertise.com == ==
___________________________________________________________________
                |
                |         Remote Workplace Server v0.70
Rich Walsh      |      interact with the WPS from any program
Ft Myers, FL    |       http://e-vertise.com/rws/rws070.zip
___________________________________________________________________
0
Rich
6/16/2006 8:59:47 PM
In article <4492bebd$0$60371$bb4e3ad8@newscene.com>,
Alex Taylor <mail.me@reply.to.address> wrote:

 >I want to make sure it _is_ a defect first.  I mean, plenty of other
 >programs must make use of different codepages, so why has nobody else
 >ever reported a similar problem (that I can find)?

did you try to use a custom control which uses GpiSetCP rather than
WinSetCP ?
BTW since your usage of WinSetCP differs from what specified in the
documentation I wonder when IBM changed it

--
bye
Alessandro
0
tin
6/17/2006 4:41:47 AM
In <Lg4kEJzxPTwY092yn@tin.it>, on 06/17/2006
   at 05:41 AM, @tin.it (Alessandro) said:

>BTW since your usage of WinSetCP differs from what specified in the
>documentation I wonder when IBM changed it

Huh?  According to what documentation?  My docs say

 #define INCL_WINCOUNTRY /* Or use INCL_WIN, INCL_PM, */
 #include <os2.h>
 HMQ      hmq;         /*  Message-queue handle. */
 ULONG    ulCodePage;  /*  Code page. */
 BOOL     rc;          /*  Success indicator. */
 rc = WinSetCp(hmq, ulCodePage);

Where is the difference?
 
Regards,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/18/2006 2:51:24 PM
In article <4495686c$1$fgrir53$mr2ice@news.west.earthlink.net>,
Steven Levine <steve53@earthlink.bogus.net> wrote:

 >>BTW since your usage of WinSetCP differs from what specified in the
 >>documentation I wonder when IBM changed it
 >
 >Huh?  According to what documentation?  My docs say
 >
 > #define INCL_WINCOUNTRY /* Or use INCL_WIN, INCL_PM, */
 > #include <os2.h>
 > HMQ      hmq;         /*  Message-queue handle. */
 > ULONG    ulCodePage;  /*  Code page. */
 > BOOL     rc;          /*  Success indicator. */
 > rc = WinSetCp(hmq, ulCodePage);
 >
 >Where is the difference?

the difference is that the documentation (Presentation Manager Programming
Guide and Reference) says that the API allows to switch between the two
codepages specified in config.sys, while it works even if the Japanese
codepage is not mentioned in the CODEPAGE statement of CONFIG.SYS
(I have CODEPAGE=850,437)

--
bye
Alessandro
0
tin
6/19/2006 12:53:16 PM
On Sat, 17 Jun 2006 05:41:47 +0100, @tin.it (Alessandro) <> wrote:
> >I want to make sure it _is_ a defect first.  I mean, plenty of other
> >programs must make use of different codepages, so why has nobody else
> >ever reported a similar problem (that I can find)?
>
> did you try to use a custom control which uses GpiSetCP rather than
> WinSetCP ?

That's next on my list of things to try.

Well actually, I don't know how to create a custom dialog control; what
I'll probably do is create a new program whose client window draws the
text directly through WM_PAINT, instead of using dialogs at all.  


> BTW since your usage of WinSetCP differs from what specified in the
> documentation I wonder when IBM changed it

It matches my documentation here...

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/19/2006 3:10:02 PM
Alex Taylor schrieb:
> I've nailed down a concrete test case for this weird problem that has been
> plagueing me:
>     http://www.cs-club.org/~alex/os2/cptest1.zip
> 
> Try running and exiting CPTEST.EXE 25 times.  It works properly 24 times.
> Starting with the 25th time, the codepage change no longer works properly,
> and the text turns into garbage.  It won't work again until a reboot.
> 
> 
> This simple program displays two static text strings -- one in basic ASCII
> characters, and one in Japanese characters.  When the program starts, it
> issues a WinSetCp() to codepage 943 (in WM_INITDLG processing).
> 
> The program allows you to toggle back and forth between codepages 850 and
> 943, but this isn't necessary to reproduce the problem.
> 
> Whenever it changes the codepage, the program resets the text control font
> to "10.Times New Roman MT 30" using WinSetPresParam().
> 
> The zipfile includes the source code.
> 
> 
> The odd thing is that exiting and restarting the program seems to be a
> crucial element in triggering the error.  Simply switching the codepage
> back and forth any number of times does not always trigger the error,
> unless the program has already been run repeatedly since the system
> started.  
> 
> I'd appreciate any suggestions.  I'm sure I must be doing something
> wrong... is there some cleanup that I'm neglecting to do before exiting?
> 

Hmm, I have been trying with my Warp 4, Fixpak16 system and I cannot 
provoke the error you are describing.

Lars
0
Lars
6/19/2006 11:09:39 PM
Alex Taylor schrieb:
> I've nailed down a concrete test case for this weird problem that has been
> plagueing me:
>     http://www.cs-club.org/~alex/os2/cptest1.zip
> 
> Try running and exiting CPTEST.EXE 25 times.  It works properly 24 times.
> Starting with the 25th time, the codepage change no longer works properly,
> and the text turns into garbage.  It won't work again until a reboot.
> 
> 
> This simple program displays two static text strings -- one in basic ASCII
> characters, and one in Japanese characters.  When the program starts, it
> issues a WinSetCp() to codepage 943 (in WM_INITDLG processing).
> 
> The program allows you to toggle back and forth between codepages 850 and
> 943, but this isn't necessary to reproduce the problem.
> 
> Whenever it changes the codepage, the program resets the text control font
> to "10.Times New Roman MT 30" using WinSetPresParam().
> 
> The zipfile includes the source code.
> 
> 
> The odd thing is that exiting and restarting the program seems to be a
> crucial element in triggering the error.  Simply switching the codepage
> back and forth any number of times does not always trigger the error,
> unless the program has already been run repeatedly since the system
> started.  
> 
> I'd appreciate any suggestions.  I'm sure I must be doing something
> wrong... is there some cleanup that I'm neglecting to do before exiting?
> 
You should use WinDestroyAccelTable to destroy the loaded accelerator 
table (immediately before using WinDestroyWindow to destroy the window). 
PM doc states that this is unnecessary but PM might have bugs in 
cleaning up resources.

Lars
0
Lars
6/19/2006 11:25:31 PM
Lars Erdmann schrieb:
> Alex Taylor schrieb:
> 
>> I've nailed down a concrete test case for this weird problem that has 
>> been
>> plagueing me:
>>     http://www.cs-club.org/~alex/os2/cptest1.zip
>>
>> Try running and exiting CPTEST.EXE 25 times.  It works properly 24 times.
>> Starting with the 25th time, the codepage change no longer works 
>> properly,
>> and the text turns into garbage.  It won't work again until a reboot.
>>
>>
>> This simple program displays two static text strings -- one in basic 
>> ASCII
>> characters, and one in Japanese characters.  When the program starts, it
>> issues a WinSetCp() to codepage 943 (in WM_INITDLG processing).
>>
>> The program allows you to toggle back and forth between codepages 850 and
>> 943, but this isn't necessary to reproduce the problem.
>>
>> Whenever it changes the codepage, the program resets the text control 
>> font
>> to "10.Times New Roman MT 30" using WinSetPresParam().
>>
>> The zipfile includes the source code.
>>
>>
>> The odd thing is that exiting and restarting the program seems to be a
>> crucial element in triggering the error.  Simply switching the codepage
>> back and forth any number of times does not always trigger the error,
>> unless the program has already been run repeatedly since the system
>> started. 
>> I'd appreciate any suggestions.  I'm sure I must be doing something
>> wrong... is there some cleanup that I'm neglecting to do before exiting?
>>
> You should use WinDestroyAccelTable to destroy the loaded accelerator 
> table (immediately before using WinDestroyWindow to destroy the window). 
> PM doc states that this is unnecessary but PM might have bugs in 
> cleaning up resources.
> 
> Lars
.... and the same holds true for WinLoadPointer (WinDestroyPointer).
You should maybe put all PM resource cleanup in WM_DESTROY. Then it will 
be automatically done when you call WinDestroyWindow from the main routine.

Lars
0
Lars
6/19/2006 11:34:53 PM
In <84plEJzxPf1I092yn@tin.it>, on 06/19/2006
   at 01:53 PM, @tin.it (Alessandro) said:

>the difference is that the documentation (Presentation Manager
>Programming Guide and Reference) says that the API allows to switch
>between the two codepages specified in config.sys, while it works even if
>the Japanese codepage is not mentioned in the CODEPAGE statement of
>CONFIG.SYS (I have CODEPAGE=850,437)

Oh that.  WinSetCp has always worked for all codepages known to PM.  The
statement you are referring to is a well-known documentation error for the
WinSetCp parameters.  If you compare this section  with the other sections
in the PM PG&R that discuss codepage support, you will set that this
section is inconsistent.

If IBM had not stopped updating the OS/2 documentation in the early 90's
I'm sure this documentation error would have been correctly by now.

Regards,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/20/2006 4:26:35 AM
In article <4496be02$0$26113$bb4e3ad8@newscene.com>,
Alex Taylor <mail.me@reply.to.address> wrote:

 >> did you try to use a custom control which uses GpiSetCP rather than
 >> WinSetCP ?
 >
 >That's next on my list of things to try.
 >
 >Well actually, I don't know how to create a custom dialog control; what
 >I'll probably do is create a new program whose client window draws the
 >text directly through WM_PAINT, instead of using dialogs at all.

just read the article I wrote a few years ago for OS2ezine
it was published on the February issue of 2002 (20020216.zip)

 >> BTW since your usage of WinSetCP differs from what specified in the
 >> documentation I wonder when IBM changed it
 >
 >It matches my documentation here...

I guess you have the proper CODEPAGE settings in CONFIG.SYS
here it works even if the Japanese codepage is not there even if
the PM Programming docs says otherwise

--
bye
Alessandro
0
tin
6/20/2006 4:42:21 AM
Steven Levine wrote:
> 
> If IBM had not stopped updating the OS/2 documentation in the early 90's
> I'm sure this documentation error would have been correctly by now.
> 

Can't we do something about this?  Maybe we as users need to take 
control of the documentation.

0
Peter
6/20/2006 10:59:18 AM
On Fri, 16 Jun 2006 16:14:48 GMT, Steven Levine <steve53@earthlink.bogus.net> wrote:
> In <4492bebd$0$60371$bb4e3ad8@newscene.com>, on 06/16/2006
>    at 09:24 AM, Alex Taylor <mail.me@reply.to.address> said:
>
>>I want to make sure it _is_ a defect first.  I mean, plenty of other
>>programs must make use of different codepages, so why has nobody else
>>ever reported a similar problem (that I can find)?  
>
> Generally, one does not change code pages all that often in an
> application.

But it's persistent across applications... so if you have several
applications that use different codepages, the error would appear in
very short order.


> The only thing that is unusual about your code is the use of WinDefDlgProc
> in the WM_INITDLG logic.  I would expect to see WinPostMsg or, worst case,
> WinSendMsg.  What is your reason for using WinDefDlgProc?

You mean for setting the icon and menu?  That's just because the sample
code I based those lines on used WinDefDlgProc.  

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/20/2006 1:50:01 PM
On Fri, 16 Jun 2006 20:59:47 GMT, Rich Walsh <spamyourself@127.0.0.1> wrote:
>> So I can't shake the suspicion that I'm doing something dumb, but I can't
>> imagine what that may be...
>
> I don't think so...  I opened e.exe, changed its CP to 950, then closed it
> at least 30 times.  At some point (and I can't say when since I was trying
> other things as well), I tried opening e's font dialog.  It took a long
> time to appear, and when it did, most controls were missing their text, and
> the font listbox was filled with squares where there should have been font
> names.  

Now that you mention it, I have sometimes noticed the font dialog taking a
long time to appear, particularly after I've been fiddling with this issue
for a while.  I'm not sure I'd actually connected the two, though.

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/20/2006 1:50:03 PM
On 19 Jun 2006 10:10:02 -0500, Alex Taylor <mail.me@reply.to.address> wrote:
>> did you try to use a custom control which uses GpiSetCP rather than
>> WinSetCP ?
>
> Well actually, I don't know how to create a custom dialog control; what
> I'll probably do is create a new program whose client window draws the
> text directly through WM_PAINT, instead of using dialogs at all.  

OK, I'm trying to do this, but I can't get GpiSetCp to actually have any
effect (although it returns TRUE, text is still rendered in CP850).

Is there an arcane secret to using GpiSetCp?


/* ---------------------------------------------------------------------- *
 * Called from WM_PAINT processing                                        *
 * ---------------------------------------------------------------------- */
MRESULT PaintClient( HWND hwnd )
{
    HPS     hps;
    RECTL   rcl;
    POINTL  ptl;
    CHAR    szText1[] = "This is English text.",
            szText2[] = "<Japanese text omitted for 7-bit Usenet safety>"
    LONG    charHeight;
    BOOL    fRc;
    FONTMETRICS fontMetrics;

    hps = WinBeginPaint( hwnd, NULLHANDLE, NULLHANDLE );
    fRc = GpiSetCp( hps, 943 );
    if ( !fRc ) ErrorPopup("Could not set codepage.");

    WinQueryWindowRect( hwnd, &rcl );
    WinFillRect( hps, &rcl, SYSCLR_WINDOW );

    WinSetPresParam( hwnd, PP_FONTNAMESIZE, 25, "10.Times New Roman MT 30");
    GpiQueryFontMetrics( hps, sizeof( FONTMETRICS ), &fontMetrics );
    charHeight = fontMetrics.lMaxBaselineExt;
    ptl.x = 5;
    ptl.y = rcl.yTop - charHeight;
    GpiMove( hps, &ptl );
    GpiCharString( hps, strlen(szText1), szText1 );
    ptl.y = ptl.y - charHeight;
    GpiMove( hps, &ptl );
    GpiCharString( hps, strlen(szText2), szText2 );

    WinEndPaint( hps );
    return 0;
}


(The rest of the program is a purely generic skeleton calling
WinCreateStdWindow, etc.)

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/20/2006 1:59:01 PM
On Tue, 20 Jun 2006 01:34:53 +0200, Lars Erdmann <lars.erdmann@arcor.de>
wrote:
>> You should use WinDestroyAccelTable to destroy the loaded accelerator 
>> table (immediately before using WinDestroyWindow to destroy the window). 
>> PM doc states that this is unnecessary but PM might have bugs in 
>> cleaning up resources.
>> 
> ... and the same holds true for WinLoadPointer (WinDestroyPointer).
> You should maybe put all PM resource cleanup in WM_DESTROY. Then it will 
> be automatically done when you call WinDestroyWindow from the main routine.

Wise suggestions, both.  

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/20/2006 2:01:02 PM
In <ayQlg.19502$W97.9916@twister.nyroc.rr.com>, on 06/20/2006
   at 10:59 AM, Peter Flass <Peter_Flass@Yahoo.com> said:

>Can't we do something about this?

Sure.

>Maybe we as users need to take 
>control of the documentation.

There's the well known

  http://www.edm2.com/index.php/Main_Page

Regards,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/21/2006 1:19:57 AM
In <4497fc5a$0$26092$bb4e3ad8@newscene.com>, on 06/20/2006
   at 08:50 AM, Alex Taylor <mail.me@reply.to.address> said:

>But it's persistent across applications... so if you have several
>applications that use different codepages, the error would appear in very
>short order.

Unfortunately, this is starting to look like a system specific issue.  I
can not replicate it on the 2.0 betas I have here and Chuck can not
replicate it on his eCS 1.2MR install.

I guess it's time to figure out what your system has in common with the
systems to do lock up.

Regards,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/21/2006 1:21:44 AM
On Tue, 20 Jun 2006 10:59:18 UTC, Peter Flass wrote:

> Can't we do something about this?  Maybe we as users need to take 
> control of the documentation.

Besides using the Wiki you can also send an email to the Mensys guys to 
change the docs as included in the Dev Toolkit for eCS.
-- 
Greetings,                                                             ^
   Peter.
0
Peter
6/21/2006 3:29:48 AM
Steven Levine <steve53@earthlink.bogus.net> wrote:
> Alex Taylor <mail.me@reply.to.address> said:
> 
> >But it's persistent across applications... so if you have several
> >applications that use different codepages, the error would appear in very
> >short order.
> 
> Unfortunately, this is starting to look like a system specific issue.  I
> can not replicate it on the 2.0 betas I have here and Chuck can not
> replicate it on his eCS 1.2MR install.
> 
> I guess it's time to figure out what your system has in common with the
> systems to do lock up.

System specific?  OK...

eCS 1.1, kernel 14.103a_UNI, CODEPAGE=850,950

Worth noting:  (1)CP950 is a DBCS codepage.  (2) Using a UNI (and presumably,
an SMP) kernel enables locale & codepage switching options in PM that are
disabled when using a W4 kernel.  These options are controlled on a per-process
basis by the "WORKPLACE_NATIVE" & "WORKPLACE_PRIMARY_CP" environment variables,
and can be set on the 'Language' page of a program object.  Which kernel have
various testers been using?



-- 
== == almost usable email address:  rich AT e-vertise.com == ==
___________________________________________________________________
                |
                |          Remote Workplace Server v0.70
Rich Walsh      |      interact with the WPS from any program
Ft Myers, FL    |       http://e-vertise.com/rws/rws070.zip
___________________________________________________________________
0
Rich
6/21/2006 4:12:55 AM
In article <4497fed3$0$26092$bb4e3ad8@newscene.com>,
Alex Taylor <mail.me@reply.to.address> wrote:

 >OK, I'm trying to do this, but I can't get GpiSetCp to actually have any
 >effect (although it returns TRUE, text is still rendered in CP850).
 >
 >Is there an arcane secret to using GpiSetCp?

try to set the font on WM_CREATE or use a different method to change
the font

--
bye
Alessandro
0
tin
6/21/2006 4:41:26 AM
For what its worth, I have also been playing around with WinSetCp and have
noticed that although it returns 1 this does not necessarilly mean that the
code page has changed !

In one program I am having problems with, the following code snippet returns
1 but the Code page does not change.
I start in CP 950 ( I am using a Tawanese version of eCS).

rc=WinSetCp(hmq,850);
CodePage=0;
CodePage=WinQueryCp(hmq);

Result after execution is
rc = 1
CodePage=950

Funny enough if I debug the code with a breakpoint on the WinSetCp the
codepage is set correctly if I then step to the next source line. A
breakpoint after the WinSetCp and it is always incorrect.  If however I
place a WinSetCp immediately after creating my message queue switching the
codepage seems to work okay :-)  :-(  :-)


Maybe you are having a similar problem with GpiSetCp in that it returns 1
but has not actually changed the codepage. I found this out with WinSetCp
when I used CpPal (Code Page Pal avialable on Hobbes) to see if the codepage
was changed.  I still don't know why this API is not working in my program
although your program switches correctly,  I do however have to start in CP
850, as otherwise it spontaneously aborts when first changing to CP 850.

By the way after starting your program a number of times (20 or more) it
would appear that the text is no longer correctly displayed, as you
indicated. I checked that the codepage change is still working using CpPal
and it is. Dropping a a different font on the text did change the characters
but it was still garbage.

"Alex Taylor" <mail.me@reply.to.address> wrote in message
news:4497fed3$0$26092$bb4e3ad8@newscene.com...
> On 19 Jun 2006 10:10:02 -0500, Alex Taylor <mail.me@reply.to.address>
wrote:
> >> did you try to use a custom control which uses GpiSetCP rather than
> >> WinSetCP ?
> >
> > Well actually, I don't know how to create a custom dialog control; what
> > I'll probably do is create a new program whose client window draws the
> > text directly through WM_PAINT, instead of using dialogs at all.
>
> OK, I'm trying to do this, but I can't get GpiSetCp to actually have any
> effect (although it returns TRUE, text is still rendered in CP850).
>
> Is there an arcane secret to using GpiSetCp?
>
>
> /* ---------------------------------------------------------------------- 
*
>  * Called from WM_PAINT processing
*
>  * ---------------------------------------------------------------------- 
*/
> MRESULT PaintClient( HWND hwnd )
> {
>     HPS     hps;
>     RECTL   rcl;
>     POINTL  ptl;
>     CHAR    szText1[] = "This is English text.",
>             szText2[] = "<Japanese text omitted for 7-bit Usenet safety>"
>     LONG    charHeight;
>     BOOL    fRc;
>     FONTMETRICS fontMetrics;
>
>     hps = WinBeginPaint( hwnd, NULLHANDLE, NULLHANDLE );
>     fRc = GpiSetCp( hps, 943 );
>     if ( !fRc ) ErrorPopup("Could not set codepage.");
>
>     WinQueryWindowRect( hwnd, &rcl );
>     WinFillRect( hps, &rcl, SYSCLR_WINDOW );
>
>     WinSetPresParam( hwnd, PP_FONTNAMESIZE, 25, "10.Times New Roman MT
30");
>     GpiQueryFontMetrics( hps, sizeof( FONTMETRICS ), &fontMetrics );
>     charHeight = fontMetrics.lMaxBaselineExt;
>     ptl.x = 5;
>     ptl.y = rcl.yTop - charHeight;
>     GpiMove( hps, &ptl );
>     GpiCharString( hps, strlen(szText1), szText1 );
>     ptl.y = ptl.y - charHeight;
>     GpiMove( hps, &ptl );
>     GpiCharString( hps, strlen(szText2), szText2 );
>
>     WinEndPaint( hps );
>     return 0;
> }
>
>
> (The rest of the program is a purely generic skeleton calling
> WinCreateStdWindow, etc.)
>
> -- 
> Alex Taylor
> http://www.cs-club.org/~alex
>
> Remove hat to reply (reply-to address).


0
Keith
6/21/2006 11:40:08 AM
On Wed, 21 Jun 2006 01:19:57 GMT, Steven Levine
<steve53@earthlink.bogus.net> wrote:
>>Maybe we as users need to take 
>>control of the documentation.
>
> There's the well known
>   http://www.edm2.com/index.php/Main_Page

On that note, I'm almost finished a major overhaul of UNIAPI.HTM, which
aims to correct some of its blatant errors, and also turn it into
something that's actually readable.  I was planning to put it into the eCS
toolkit, but maybe EDM/2 would be interested as well...

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/21/2006 2:05:03 PM
On Wed, 21 Jun 2006 01:21:44 GMT, Steven Levine
<steve53@earthlink.bogus.net> wrote:
>>But it's persistent across applications... so if you have several
>>applications that use different codepages, the error would appear in very
>>short order.
>
> Unfortunately, this is starting to look like a system specific issue.  I
> can not replicate it on the 2.0 betas I have here and Chuck can not
> replicate it on his eCS 1.2MR install.

But I can reproduce it on every system I've tried it on.  Including, but
not limited to, WSeB FP3, eCS 1.1, eCS 1.2, Warp Server FP43, Warp Connect
FP40, and Warp 4 FP17.  (And yes, some of them are actually real PCs...)

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/21/2006 2:07:02 PM
I'd previously thought otherwise, but now after some experimentation I've
discovered that Ken Borgendale's sample SHOWCP.EXE program (from
<http://www.borgendale.com/tools/tools.htm>) also triggers this problem.

So I think it's safe to conclude that it's not a programmatical error.


It's not specific to using dialog controls either.  Using a client window
in a standard frame and drawing the text manually from WM_PAINT is also
susceptible to the error.


But here's the real mystery.  Once this error appears, _all_ programs
which use WinSetCp to change the display codepage will fail... EXCEPT
Mozilla!  No Mozilla-based application seems affected by this bug, not
even once it's infected the running system.

So what in the world is Mozilla doing that renders it immune?!?  Could
Mozilla be bypassing the PM codepage handling completly, and using its own
method to extract glyphs from fonts according to codepage?


(Or is Mozilla using GpiSetCp only, somehow?  I still can't determine
whether GpiSetCp causes the error, because I can't get the function to do
anything at all.  The toolkit docs say GpiSetCp can only use one of the
CONFIG.SYS codepages; I'd sort of assumed that was another falsehood, but
what do I know?)

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/21/2006 2:19:02 PM
Alex Taylor wrote:
> I'd previously thought otherwise, but now after some experimentation I've
> discovered that Ken Borgendale's sample SHOWCP.EXE program (from
> <http://www.borgendale.com/tools/tools.htm>) also triggers this problem.
> 
> So I think it's safe to conclude that it's not a programmatical error.
> 
> 
> It's not specific to using dialog controls either.  Using a client window
> in a standard frame and drawing the text manually from WM_PAINT is also
> susceptible to the error.
> 
> 
> But here's the real mystery.  Once this error appears, _all_ programs
> which use WinSetCp to change the display codepage will fail... EXCEPT
> Mozilla!  No Mozilla-based application seems affected by this bug, not
> even once it's infected the running system.
> 
> So what in the world is Mozilla doing that renders it immune?!? 

IIRC, Mozilla uses just the basic PM window support, but regions of 
those windows are painted completely, down to the last pixel, by Mozilla 
alone.

> Could
> Mozilla be bypassing the PM codepage handling completly, and using its own
> method to extract glyphs from fonts according to codepage?
> 
> 
> (Or is Mozilla using GpiSetCp only, somehow?  I still can't determine
> whether GpiSetCp causes the error, because I can't get the function to do
> anything at all.  The toolkit docs say GpiSetCp can only use one of the
> CONFIG.SYS codepages; I'd sort of assumed that was another falsehood, but
> what do I know?)
> 


-- 
Cheers,
Martin

UNDERSCOREmmiATcentrumDOTcz to email me
0
MMI
6/21/2006 6:25:32 PM
In <449954ed$0$33422$bb4e3ad8@newscene.com>, on 06/21/2006
   at 09:19 AM, Alex Taylor <mail.me@reply.to.address> said:

>So I think it's safe to conclude that it's not a programmatical error.

It's something specific to certain system setups.  Could be almost
anything PM/GPI related.

>So what in the world is Mozilla doing that renders it immune?!?

Best I can tell Mozilla does not switch codepages.  The current codepage
is used for setting defaults and fallbacks.

>Could
>Mozilla be bypassing the PM codepage handling completly, and using its
>own method to extract glyphs from fonts according to codepage?

Mozilla, like Describe, switches fonts on a per character basis,

>(Or is Mozilla using GpiSetCp only, somehow?

I doubt it, but I didn't do a full search.  Most of the relevant code is
in mozilla\gfx\src\os2.

>I still can't determine
>whether GpiSetCp causes the error, because I can't get the function to do
>anything at all.  The toolkit docs say GpiSetCp can only use one of the
>CONFIG.SYS codepages; I'd sort of assumed that was another falsehood, but
>what do I know?)

Not to worry.  The docs are wrong.  I suspect your problem is that the
codepage set by GpiSetCp is mostly a default setting.  It will not be used
when you create a logical font, unless you pass a 0 in the FATTRS codepage
field.  Also, the font actually needs to contain glyphs for the requested
codepage.  What should work is

  GpiSetCp()
  GpiCreateLogFont()
  CpiCharStringAt()
  .,,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/21/2006 8:14:21 PM
Hallo Alex,

Yes, please put it at a public place so that Warp Users are not locked out 
....

Lars

"Alex Taylor" <mail.me@reply.to.address> schrieb im Newsbeitrag 
news:44995166$0$33422$bb4e3ad8@newscene.com...
> On Wed, 21 Jun 2006 01:19:57 GMT, Steven Levine
> <steve53@earthlink.bogus.net> wrote:
>>>Maybe we as users need to take
>>>control of the documentation.
>>
>> There's the well known
>>   http://www.edm2.com/index.php/Main_Page
>
> On that note, I'm almost finished a major overhaul of UNIAPI.HTM, which
> aims to correct some of its blatant errors, and also turn it into
> something that's actually readable.  I was planning to put it into the eCS
> toolkit, but maybe EDM/2 would be interested as well...
>
> -- 
> Alex Taylor
> http://www.cs-club.org/~alex
>
> Remove hat to reply (reply-to address). 


0
Lars
6/21/2006 9:38:23 PM
On Mon, 19 Jun 2006 23:09:39 UTC, Lars Erdmann <lars.erdmann@arcor.de> wrote:

> >     http://www.cs-club.org/~alex/os2/cptest1.zip
> > Try running and exiting CPTEST.EXE 25 times.  It works properly 24 times.
> > Starting with the 25th time, the codepage change no longer works properly,
> > and the text turns into garbage.  It won't work again until a reboot.
> 
> Hmm, I have been trying with my Warp 4, Fixpak16 system and I cannot 
> provoke the error you are describing.

Strange.  I can definitely reproduce it on Warp 4 Fixpak 17, Warp 3 FixPak 40,
Warp Server SMP FixPak 43, WSeB FixPak 3, and eComStation...

Did you try for more than 25 times?  A couple of times I've encountered
situations where it takes more tries than that, although usually not too
much more.

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/21/2006 9:59:02 PM
In <EzI08Q3LwTQm-pn2-Kn3sQwPms5RK@localhost>, on 06/21/2006
   at 04:59 PM, "Alex Taylor" <mail.me@reply.to.address> said:

>Strange.  I can definitely reproduce it on Warp 4 Fixpak 17, Warp 3
>FixPak 40, Warp Server SMP FixPak 43, WSeB FixPak 3, and eComStation...

>Did you try for more than 25 times?  A couple of times I've encountered
>situations where it takes more tries than that, although usually not too
>much more.

I'm pretty sure I did.  I didn't count, but I hit F7/F8 for a couple of
minutes, so that should be enough.  I'll try again later and make sure I
do 200 toggles. :-)

It just a guess, but I would have to suspect that the defect has something
to do with DBCS fonts.  Most of us don't have any DBCS fonts installed so
our glyphs are going to come from the Unicode font.

Regards,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/22/2006 12:35:38 AM
On Thu, 22 Jun 2006 00:35:38 GMT, Steven Levine <steve53@earthlink.bogus.net> wrote:
>>Did you try for more than 25 times?  A couple of times I've encountered
>>situations where it takes more tries than that, although usually not too
>>much more.
>
> I'm pretty sure I did.  I didn't count, but I hit F7/F8 for a couple of
> minutes, so that should be enough.  I'll try again later and make sure I
> do 200 toggles. :-)

No, it's not toggling that triggers the problem!  It's specifically
running and exiting the program 25 times.


(Well, I have seen the problem occur while toggling, but I'm not sure
under what circumstances.  But I've toggled back and forth over 200 times
without reproducing it.)
-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/22/2006 2:46:15 PM
In <449aacb5$0$26076$bb4e3ad8@newscene.com>, on 06/22/2006
   at 09:46 AM, Alex Taylor <mail.me@reply.to.address> said:

>No, it's not toggling that triggers the problem!  It's specifically
>running and exiting the program 25 times.

That's not what you said at first. :-)

<snip>
The problem I see is that after switching the PM codepage using
WinSetCp(hmq) a certain number of times (within the same or different
programs, it makes no difference), it will stop working -- for all
applications!  The characters being displayed turn into meaningless
garbage.  Only rebooting will restore normal functionality. </snip>

Looking at some other messages, I see you restated with the enter/exit
requirement.  I will retest.

Regards,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/22/2006 6:12:24 PM
On Thu, 22 Jun 2006 18:12:24 UTC, Steven Levine <steve53@earthlink.bogus.net> wrote:

> >No, it's not toggling that triggers the problem!  It's specifically
> >running and exiting the program 25 times.
> 
> That's not what you said at first. :-)

It is, from when I started describing a concrete reproduction scenario. :)

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/22/2006 10:02:02 PM
On Wed, 21 Jun 2006 04:41:26 UTC,         @tin.it (Alessandro) wrote:

>  >OK, I'm trying to do this, but I can't get GpiSetCp to actually have any
>  >effect (although it returns TRUE, text is still rendered in CP850).
>  >
>  >Is there an arcane secret to using GpiSetCp?
> 
> try to set the font on WM_CREATE or use a different method to change
> the font

I did, but Steve pointed me to the correct incantation.  I have to set 
the font using GpiCreateLogFont and GpiSetCharSet, and not through the
PM presentation parameters.

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/22/2006 10:03:02 PM
On Wed, 21 Jun 2006 20:14:21 UTC, Steven Levine <steve53@earthlink.bogus.net> wrote:

> Not to worry.  The docs are wrong.  I suspect your problem is that the
> codepage set by GpiSetCp is mostly a default setting.  It will not be used
> when you create a logical font, unless you pass a 0 in the FATTRS codepage
> field.  Also, the font actually needs to contain glyphs for the requested
> codepage.  What should work is
> 
>   GpiSetCp()
>   GpiCreateLogFont()
>   CpiCharStringAt()

Ah, cunning.  Experimentation reveals that, using this approach, I don't
even have to use GpiSetCp if I specify 943 in the usCodePage field of
FATTRS.

I wonder, though... does this limit me to custom-created controls?  Or
is there some way to use this technique on standard dialog controls?  
I'd better dig out my textbook and start reading up on GPI...


On the other hand, more experimentation reveals that this method, too,
seems to cause the error (after about 50 executions, in this case).
http://www.cs-club.org/~alex/os2/cptest2.zip

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/22/2006 10:12:01 PM
Alex Taylor schrieb:
> On Mon, 19 Jun 2006 23:09:39 UTC, Lars Erdmann <lars.erdmann@arcor.de> wrote:
> 
> 
>>>    http://www.cs-club.org/~alex/os2/cptest1.zip
>>>Try running and exiting CPTEST.EXE 25 times.  It works properly 24 times.
>>>Starting with the 25th time, the codepage change no longer works properly,
>>>and the text turns into garbage.  It won't work again until a reboot.
>>
>>Hmm, I have been trying with my Warp 4, Fixpak16 system and I cannot 
>>provoke the error you are describing.
> 
> 
> Strange.  I can definitely reproduce it on Warp 4 Fixpak 17, Warp 3 FixPak 40,
> Warp Server SMP FixPak 43, WSeB FixPak 3, and eComStation...
> 
> Did you try for more than 25 times?  A couple of times I've encountered
> situations where it takes more tries than that, although usually not too
> much more.
> 

Yes, I have started it considerably more often than 25 times.
I have 437 as my primary and 850 as the secondary codepage but not 943.
943 will give me spaces and boxes for quite a few characters in the 
"string under test" but the other characters are allright.

Lars
0
Lars
6/22/2006 10:45:25 PM
Alex Taylor schrieb:
> On Wed, 21 Jun 2006 20:14:21 UTC, Steven Levine <steve53@earthlink.bogus.net> wrote:
> 
> 
>>Not to worry.  The docs are wrong.  I suspect your problem is that the
>>codepage set by GpiSetCp is mostly a default setting.  It will not be used
>>when you create a logical font, unless you pass a 0 in the FATTRS codepage
>>field.  Also, the font actually needs to contain glyphs for the requested
>>codepage.  What should work is
>>
>>  GpiSetCp()
>>  GpiCreateLogFont()
>>  CpiCharStringAt()
> 
> 
> Ah, cunning.  Experimentation reveals that, using this approach, I don't
> even have to use GpiSetCp if I specify 943 in the usCodePage field of
> FATTRS.
> 
> I wonder, though... does this limit me to custom-created controls?  Or
> is there some way to use this technique on standard dialog controls?  
> I'd better dig out my textbook and start reading up on GPI...
> 
> 
> On the other hand, more experimentation reveals that this method, too,
> seems to cause the error (after about 50 executions, in this case).
> http://www.cs-club.org/~alex/os2/cptest2.zip
> 
I cannot reproduce it. I can see the string "this is english text" but I 
cannot read the japanese text even after using CPPal to change the CP to 
943.

Maybe it's because I use a Warp 4 kernel (and its 14.104 which is the 
latest.)

Lars
0
Lars
6/22/2006 10:55:52 PM
Lars Erdmann wrote:

> Maybe it's because I use a Warp 4 kernel (and its 14.104 which is the 
> latest.)
> 
  More likely you don't have the right fonts. This is really a PM thing, 
not a kernel thing, and I know for a fact that Warp 4 (fixpacked at 
least) has no trouble displaying Japanese or Chinese. But Warp 4 did not 
come with the necessary fonts - some came with Java, some with MCP.


        Michal
0
Michal
6/22/2006 11:34:05 PM
In <EzI08Q3LwTQm-pn2-SimPu8Mrs1B4@localhost>, on 06/22/2006
   at 05:02 PM, "Alex Taylor" <mail.me@reply.to.address> said:

>It is, from when I started describing a concrete reproduction scenario.
>:)

The good news is it now fails for me on my DIY system, so it should
probably fail on almost any basic MCP/eCS box.  This meanbs IBM should be
able to replicate it.

I am suspecting a file handle leak in pmshell, but I can't prove it yet.
os2trace does not show anything useful, but I have not yet instrumented
any of the PM DLLs.

Regards,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/22/2006 11:48:29 PM
In <EzI08Q3LwTQm-pn2-mSCPdGSWtiCH@localhost>, on 06/22/2006
   at 05:12 PM, "Alex Taylor" <mail.me@reply.to.address> said:

>>   GpiSetCp()
>>   GpiCreateLogFont()
>>   CpiCharStringAt()

>Ah, cunning.  Experimentation reveals that, using this approach, I don't
>even have to use GpiSetCp if I specify 943 in the usCodePage field of
>FATTRS.

Exactly.  That's why I said GpiSetCp essentially sets a default.  There
are a number of ways to override this default.

>I wonder, though... does this limit me to custom-created controls?  Or is
>there some way to use this technique on standard dialog controls?   I'd
>better dig out my textbook and start reading up on GPI...

It depends on how you look at it.  The PM API layers on top of the GPI
API.  When writing to the PM API, you are supposed to use PMSetCp because
that way PM knows what you want.  When you use GpiSetCp, you bypass PM, so
it's your job to make sure things work as you expect.

>On the other hand, more experimentation reveals that this method, too,
>seems to cause the error (after about 50 executions, in this case).

I guess that mean PMSetCp must be invoking GpiSetCp multiple times.  It
should be interesting to see what os2trace has to say when tracing
pmgpi.dll.

Regards,

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/23/2006 12:01:21 AM
On Thu, 22 Jun 2006 23:48:29 UTC, Steven Levine <steve53@earthlink.bogus.net> wrote:

> I am suspecting a file handle leak in pmshell, but I can't prove it yet.

Why?  My system is in that "state" yet Theseus shows pmshell has 16 open
handles out of an available 57.  Anyway...

The problem appears to be solely with PM's mapping of the glyphs in a
*unicode* font to a specific codepage.  While Times New Roman MT 30
and Arial Unicode MS display garbage, I can switch to a Japanese font,
HeseiKakuGothic-W5-78-TT (dfhsg-78.ttf), and the text looks as it
should.


-- 
== == almost usable email address:  rich AT e-vertise.com == ==
___________________________________________________________________
                |
                |         Remote Workplace Server v0.70
Rich Walsh      |      interact with the WPS from any program
Ft Myers, FL    |       http://e-vertise.com/rws/rws070.zip
___________________________________________________________________
0
Rich
6/23/2006 6:09:26 AM
In <brddYgxvE0gm-pn2-hrwDdfgRvQSL@localhost>, on 06/23/2006
   at 06:09 AM, "Rich Walsh" <spamyourself@127.0.0.1> said:

>Why?  My system is in that "state" yet Theseus shows pmshell has 16 open
>handles out of an available 57.  Anyway...

I'm not thinking of system file handles.  I checked this with psfiles. 
I'm thinking more along the lines of some list of file handles within the
runtime of one of the PM DLLs.  Perhaps PMGPI.  Perhaps elsewhere.  This
is all speculation unless I can figure out how to see where the code is
actually failing.

>The problem appears to be solely with PM's mapping of the glyphs in a
>*unicode* font to a specific codepage.  While Times New Roman MT 30 and
>Arial Unicode MS display garbage, I can switch to a Japanese font,
>HeseiKakuGothic-W5-78-TT (dfhsg-78.ttf), and the text looks as it should.

Interesting, but not that unexpected.  The unicode logic is relatively
new, compared to the rest of the PM code.

Steven

-- 
--------------------------------------------------------------------------------------------
Steven Levine <steve53@earthlink.bogus.net>  MR2/ICE 2.67 #10183
Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------

0
Steven
6/23/2006 6:36:57 AM
On Tue, 20 Jun 2006 05:42:21 +0100, @tin.it (Alessandro) <> wrote:
> >Well actually, I don't know how to create a custom dialog control; what
> >I'll probably do is create a new program whose client window draws the
> >text directly through WM_PAINT, instead of using dialogs at all.
>
> just read the article I wrote a few years ago for OS2ezine
> it was published on the February issue of 2002 (20020216.zip)

Now that's interesting.  Thanks!

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/23/2006 2:06:01 PM
On Fri, 23 Jun 2006 00:45:25 +0200, Lars Erdmann <lars.erdmann@arcor.de> wrote:
> Yes, I have started it considerably more often than 25 times.
> I have 437 as my primary and 850 as the secondary codepage but not 943.
> 943 will give me spaces and boxes for quite a few characters in the 
> "string under test" but the other characters are allright.

If it gives you spaces and boxes, that is usually a sign of the error.
Without the error you should be getting Japanese letters (assuming you
have Times New Roman MT 30 installed).

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/23/2006 2:18:02 PM
On Fri, 23 Jun 2006 06:09:26 GMT, Rich Walsh <spamyourself@127.0.0.1> wrote:
>> I am suspecting a file handle leak in pmshell, but I can't prove it yet.
>
> Why?  My system is in that "state" yet Theseus shows pmshell has 16 open
> handles out of an available 57.  Anyway...
>
> The problem appears to be solely with PM's mapping of the glyphs in a
> *unicode* font to a specific codepage.  While Times New Roman MT 30
> and Arial Unicode MS display garbage, I can switch to a Japanese font,
> HeseiKakuGothic-W5-78-TT (dfhsg-78.ttf), and the text looks as it
> should.

How are you doing it?  Setting either of the Heisei fonts within my 
test program instead of TNRMT30 still exhibits the error here... Ditto
using the font palette...

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/23/2006 2:20:01 PM
>>I wonder, though... does this limit me to custom-created controls?  Or is
>>there some way to use this technique on standard dialog controls?   I'd
>>better dig out my textbook and start reading up on GPI...
>
> It depends on how you look at it.  The PM API layers on top of the GPI
> API.  When writing to the PM API, you are supposed to use PMSetCp because
> that way PM knows what you want.  When you use GpiSetCp, you bypass PM, so
> it's your job to make sure things work as you expect.

.... which is the real trick, isn't it? :)


>>On the other hand, more experimentation reveals that this method, too,
>>seems to cause the error (after about 50 executions, in this case).
>
> I guess that mean PMSetCp must be invoking GpiSetCp multiple times.  It
> should be interesting to see what os2trace has to say when tracing
> pmgpi.dll.

Even with WinSetCp, the number of invocations necessary to trigger the
error seems to vary by program.  

My first test program uses two static text controls whose font is set to
Times New Roman MT 30 -- one with English text, and the other with
Japanese.  I've since tried changing it so that only the one with Japanese
text used the Unicode font, and all of a sudden it took longer to trigger
the error -- about 50 times as opposed to 25 (although I didn't count very
carefully).

The second test program draws directly onto the client window, and so only
needs to set the font once.  That may be why it takes longer to trigger.

This now leads me to suspect it has something more to do with setting the
font than with the actual codepage switch.  

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/23/2006 2:28:01 PM
Alex Taylor schrieb:
> On Fri, 23 Jun 2006 00:45:25 +0200, Lars Erdmann <lars.erdmann@arcor.de> wrote:
> 
>>Yes, I have started it considerably more often than 25 times.
>>I have 437 as my primary and 850 as the secondary codepage but not 943.
>>943 will give me spaces and boxes for quite a few characters in the 
>>"string under test" but the other characters are allright.
> 
> 
> If it gives you spaces and boxes, that is usually a sign of the error.
> Without the error you should be getting Japanese letters (assuming you
> have Times New Roman MT 30 installed).
> 
No, I only have "Time New Roman". Where do I get "Times New Roman MT 30" 
and how do I install it ?

Lars
0
Lars
6/23/2006 6:06:08 PM
On Fri, 23 Jun 2006 14:20:01 UTC, Alex Taylor <mail.me@reply.to.address> wrote:
> On Fri, 23 Jun 2006 06:09:26 GMT, Rich Walsh <spamyourself@127.0.0.1> wrote:
> >
> > The problem appears to be solely with PM's mapping of the glyphs in a
> > *unicode* font to a specific codepage.  While Times New Roman MT 30
> > and Arial Unicode MS display garbage, I can switch to a Japanese font,
> > HeseiKakuGothic-W5-78-TT (dfhsg-78.ttf), and the text looks as it
> > should.
> 
> How are you doing it?  Setting either of the Heisei fonts within my 
> test program instead of TNRMT30 still exhibits the error here... Ditto
> using the font palette...

Sorry, I should have been more specific.  After your app had trashed my
system <bg>, I used both e.exe and a viewer app I'd written which displays
text in a listbox.  In both cases, your Japanese text turned to blanks
when I dropped the unicode fonts on their windows but displayed correctly
with HeseiKaku.  I didn't even try to change the font in your app.

BTW... I've packaged a revised version of CpPal along with a fairly cheesy
DBCS-friendly viewer app.  You can get it from:
  http://e-vertise.com/misc/cpv,zip

The major change in CpPal is that it uses an asterisk to identify which
codepages you can use in config.sys.  The viewer is useful when you want
to look at DBCS text but don't have a DBCS system codepage set in
config.sys (most DBCS glyphs are double-width and the MLE scrunches
them up into an unreadable mess - listboxes don't exhibit this problem).
A minor convenience:  the viewer remembers the last codepage & font
you used, so you don't have to keep resetting them.


-- 
== == almost usable email address:  rich AT e-vertise.com == ==
___________________________________________________________________
                |
                |          Remote Workplace Server v0.70
Rich Walsh      |      interact with the WPS from any program
Ft Myers, FL    |       http://e-vertise.com/rws/rws070.zip
___________________________________________________________________
0
Rich
6/23/2006 8:22:42 PM
On Fri, 23 Jun 2006 20:22:42 UTC, "Rich Walsh" <spamyourself@127.0.0.1> wrote:

> BTW... I've packaged a revised version of CpPal along with a fairly cheesy
> DBCS-friendly viewer app.  You can get it from:
>   http://e-vertise.com/misc/cpv,zip

Ooops...  the copy of the viewer app I uploaded was missing a little feature:
the ability to pass it a file on the command line.  If you downloaded cpv.zip
prior to 0220 UTC 2006-06-24 (10:20pm EDT Jun 23), please get the revised
version.


-- 
== == almost usable email address:  rich AT e-vertise.com == ==
___________________________________________________________________
                |
                |          Remote Workplace Server v0.70
Rich Walsh      |      interact with the WPS from any program
Ft Myers, FL    |       http://e-vertise.com/rws/rws070.zip
___________________________________________________________________
0
Rich
6/24/2006 2:27:12 AM
On Fri, 23 Jun 2006 14:28:01 UTC, Alex Taylor <mail.me@reply.to.address> wrote:

> This now leads me to suspect it has something more to do with setting the
> font than with the actual codepage switch.  

I thought that had been established.  Just to confirm it, I kept reopening
my viewer app until I couldn't stand it any more (113 times) with no problem
using HeseiKaku.  I then opened your test app 25 times & the problem recurred.
As soon as I dropped HeseiKaku on your app's Japanese static text field, the
text was displayed as it should be.  So, it's not a codepage problem, per se,
nor a general font problem.  It is solely(?) a problem mapping unicode fonts
to a specific codepage.  I'll leave it to others (or IBM) to identify the
root cause.



-- 
== == almost usable email address:  rich AT e-vertise.com == ==
___________________________________________________________________
                |
                |          Remote Workplace Server v0.70
Rich Walsh      |      interact with the WPS from any program
Ft Myers, FL    |       http://e-vertise.com/rws/rws070.zip
___________________________________________________________________
0
Rich
6/24/2006 2:56:57 AM
Rich Walsh wrote:
>>  http://e-vertise.com/misc/cpv,zip
                                  ^
                                  |
Typo in URL.

0
Peter
6/24/2006 11:59:52 AM
On Fri, 23 Jun 2006 18:06:08 UTC, Lars Erdmann <lars.erdmann@arcor.de> wrote:

> >>Yes, I have started it considerably more often than 25 times.
> >>I have 437 as my primary and 850 as the secondary codepage but not 943.
> >>943 will give me spaces and boxes for quite a few characters in the 
> >>"string under test" but the other characters are allright.
> > 
> > If it gives you spaces and boxes, that is usually a sign of the error.
> > Without the error you should be getting Japanese letters (assuming you
> > have Times New Roman MT 30 installed).
> 
> No, I only have "Time New Roman". Where do I get "Times New Roman MT 30" 
> and how do I install it ?

It's installed out of the box on WSeB, MCP, ACP, and eCS (unless you go
and deselect it during installation).  It's also installed on Warp 4 and
Warp 3 if you install Java 1.1.8 from the JAVAINUF package.

Or you can get the files off a WSeB, MCP, ACP, or eCS install CD by going
to \OS2IMAGE\FI\FONT, unzipping TNRWT_J.ZIP to the location of your choice,
and using the Font Palette to install the fonts from that location.  (In
this version the main font file is Times New Roman WT J, and the CMB file
creates an alias to Times New Roman MT 30, for Warp 3/4 compatibility.)

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/25/2006 5:50:02 PM
> Sorry, I should have been more specific.  After your app had trashed my
> system <bg>, I used both e.exe and a viewer app I'd written which displays
> text in a listbox.  In both cases, your Japanese text turned to blanks
> when I dropped the unicode fonts on their windows but displayed correctly
> with HeseiKaku.  I didn't even try to change the font in your app.

Well, I can't get Heisei to work any better than any other Unicode or
Japanese font once the error starts.  Either in your app, or mine.  This
is what it looks like in cpview:
    http://www.cs-club.org/~alex/os2/cpview1.gif


> BTW... I've packaged a revised version of CpPal along with a fairly cheesy
> DBCS-friendly viewer app.  You can get it from:
>   http://e-vertise.com/misc/cpv.zip

Handy.  Thanks!  (I'm a big user of CPPal, BTW.  Especially so since the
latest versions of AE sadly removed the codepage switching feature.)


> The major change in CpPal is that it uses an asterisk to identify which
> codepages you can use in config.sys.  The viewer is useful when you want
> to look at DBCS text but don't have a DBCS system codepage set in
> config.sys (most DBCS glyphs are double-width and the MLE scrunches
> them up into an unreadable mess - listboxes don't exhibit this problem).

Oh, I discovered that ages ago. :)  At the moment I have 943 as my
secondary CONFIG.SYS codepage at home, so I can switch to DBCS and have
text editors actually work... :)

The Japanese dictionary frontend I'm trying to write uses a container for
the output, so as to circumvent that little problem.  And my DBCS
character map uses a valueset, which also seems OK.  Or would be, if both
programs weren't subject to the problem that started this whole thread... :|

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/26/2006 3:04:01 PM
On 26 Jun 2006 10:04:01 -0500, Alex Taylor <mail.me@reply.to.address> wrote:
>> Sorry, I should have been more specific.  After your app had trashed my
>> system <bg>, I used both e.exe and a viewer app I'd written which displays
>> text in a listbox.  In both cases, your Japanese text turned to blanks
>> when I dropped the unicode fonts on their windows but displayed correctly
>> with HeseiKaku.  I didn't even try to change the font in your app.
>
> Well, I can't get Heisei to work any better than any other Unicode or
> Japanese font once the error starts.  Either in your app, or mine.  This
> is what it looks like in cpview:
>     http://www.cs-club.org/~alex/os2/cpview1.gif

OK, I rebooted and tried again, this time triggering the problem
exclusively by using the Font Palette to change fonts.  Eventually I found
myself in a state where Unicode fonts would fail, but HeiseiMincho would
work.


>> BTW... I've packaged a revised version of CpPal along with a fairly cheesy
>> DBCS-friendly viewer app.  You can get it from:
>>   http://e-vertise.com/misc/cpv.zip
>
> Handy.  Thanks!  (I'm a big user of CPPal, BTW.  Especially so since the
> latest versions of AE sadly removed the codepage switching feature.)

Well, I have what I might be considered good news from my perspective, but
bad news from yours... I am capable of reproducing the error using only
CPPal + CPView.  It takes a lot of iterations, though (I lost count).

Incidentally, once I did that not even HeiseiMincho worked (again)...

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/27/2006 2:38:01 PM
On Tue, 27 Jun 2006 14:38:01 UTC, Alex Taylor <mail.me@reply.to.address> wrote:
> On 26 Jun 2006 10:04:01 -0500, Alex Taylor <mail.me@reply.to.address> wrote:

> Well, I have what I might be considered good news from my perspective, but
> bad news from yours... I am capable of reproducing the error using only
> CPPal + CPView.  It takes a lot of iterations, though (I lost count).
> 
> Incidentally, once I did that not even HeiseiMincho worked (again)...

I'm not sure I understand the particulars (though the generalities are
clear enough).  Were you using CPPal to change CPView from 943 to
something else, then back to 943?  The reason I ask is that CPView
opens in whatever codepage was in use when last closed.  Repeatedly
dropping 943 on it after it has opened _should_ have no effect if it
was closed while 943 was in effect.

Something else to consider:  unlike your demo, CPView changes the CP
immediately after it creates a message queue - IOW, before it creates
any windows.  I have to wonder if this has any salutory effect (after
all, opening CPView 113 times with a non-unicode font didn't trigger
the problem).


-- 
== == almost usable email address:  rich AT e-vertise.com == ==
___________________________________________________________________
                |
                |       New - Remote Workplace Server v0.70
Rich Walsh      |      interact with the WPS from any program
Ft Myers, FL    |       http://e-vertise.com/rws/rws070.zip
___________________________________________________________________
0
Rich
6/30/2006 1:57:23 AM
On Fri, 30 Jun 2006 01:57:23 GMT, Rich Walsh <spamyourself@127.0.0.1> wrote:
>> Well, I have what I might be considered good news from my perspective, but
>> bad news from yours... I am capable of reproducing the error using only
>> CPPal + CPView.  It takes a lot of iterations, though (I lost count).
>> 
>> Incidentally, once I did that not even HeiseiMincho worked (again)...
>
> I'm not sure I understand the particulars (though the generalities are
> clear enough).  Were you using CPPal to change CPView from 943 to
> something else, then back to 943?  The reason I ask is that CPView
> opens in whatever codepage was in use when last closed.  Repeatedly
> dropping 943 on it after it has opened _should_ have no effect if it
> was closed while 943 was in effect.

I did the following:
1. Open CPView
2. Open CPPal and drag codepage 943 onto CPView.
3. Open Font Palette and drag Times New Roman WT J onto CPView.
4. Use paste option to paste a string of (Japanese) text into CPView.
5. Close CPView.
6. Open CPView.
7. Repeat steps 4 to 6 until error appears.  (Took quite a long time.)
8. Try dragging HeiseiMincho-90-W3-TT onto CPView.  Text still borked.


> Something else to consider:  unlike your demo, CPView changes the CP
> immediately after it creates a message queue - IOW, before it creates
> any windows.  I have to wonder if this has any salutory effect (after
> all, opening CPView 113 times with a non-unicode font didn't trigger
> the problem).

Interesting.  I may play around with that.

-- 
Alex Taylor                                        
http://www.cs-club.org/~alex

Remove hat to reply (reply-to address).
0
Alex
6/30/2006 2:38:02 PM
Reply:

Similar Artilces:

Counting the number of times a report is previewed and the number of times printed.
Hi all, I have a customer that requires a very secure application. I can do everything they want except count report prints and previews. Their application has to count the number of times :- - Each report is previewed to the screen, - The number of times the report is actually sent to a printer. The count is to be recorded in a log with date,time, user, report name etc. I am thinking of making two copies of each report. One that can only preview and the other that can only print to the printer. Then counting once when either one is run. This means a parameter for every report procedure to...

Number of times number repeats
Hi im trying to write a program that will read in numbers and display them in ascending order along with a count of how many times it repeats. i got the numerical order portion done but cant figure out the other part. i keep on getting a wrong number please help #include <iostream> using namespace std; int main() { int numbers[4] = {8,3,8,5}; int temp, counter, index, see, times, appears; for (counter = 0; counter < 4; counter++) { for (index = 0; index < 4 - counter; index++) { if (numbers[index] > numbers[index + 1]) { ...

Reading values of I/Os at certain times from verilog
Hi guys, I'm trying to implement a testbench in verilog to measure the periodicity of an unknown pseudo-random number generator. Right now, the only ideas I have involve writing the values of the output samples onto a text file and trying to analyse the repetition from there. Is there perhaps, a system task that allows me to obtain the value of an output at a certain simulation time? Thanks! On Nov 14, 11:30=A0am, melvin...@gmail.com wrote: > Hi guys, > > I'm trying to implement a testbench in verilog to measure the > periodicity of an unknown pseudo-r...

Programmers, Programmers, Programmers, ...
As Steve Balmer correctly stated, while making his monkey dance, it is applications and hence programmers that make a platform. The fact though is that if you want to do professional programming, then Linux is the platform for you. I know that this statement will get the heckels up on a lot of trolls in C.O.L.A, but I have a recent experience that proves this. I am currently working for a Windows only house producing a system that receives and transmits around 1000 telegrams per second in each direction on a UDP socket, translates them into a different format and creates a log entry for each ...

interp1 to a certain number (time normalization of data)
Dear all! I am facing a small problem (Matlab 7.0.4), which I hope might be solved by some of you. I am trying to interpolate one-dimensional data of different measurements of different lenghts to one exact length for time normalizaton of data. Let's assume we have recorded two vectors of different lenghts: a = 1:14; b = 9:42; I want both vectors to have a length of 100 (but within the given boundaries (1:length(a) and 1:length(b) respectively). In the end I will use a_int = interp1(1:length(a),a,xi_a); When I calculate my xi_a = 1:length(a)/100:length(a) I - no surpris...

How to find number of times certain conditions happened in an array?
Dear Gurus, I would like to implement a function that computes the number of times a certain condition is met in a global array. For example, I have an global array of size 500. float array[500]; I have a function that finds the maximum of an array of size 50. bool findMax50(float input[]) Next, I want to implement a function that can do the following; Sum( findMax50(array), period) If period is 20, then this function will start at the last element of the global array and will return 1 if this element is a maximum among the 50 elements it covers. Then, it moves on to the (last -1)th eleme...

Need help: Algorithm to check whether a number falls into certain range.
Hi, I am pretty sure somebody out there had solved this problem before. Given a number, for example, 403491005, I would like to check if it falls into one of the ranges. Example of the ranges: (they are about 2000 to 3000 different ranges) 403491000-403491999 403492000-403492999 416894000-416894999 421066000-421066999 499979000-499979999 513717000-513717999 547959000-547959999 What would be the best implementation for this problem? I am c...

How to calculate rising time and falling time
Just wondering to how to calculate the rising time and falling time of an evaporation graph. The axis are Resistance vs Time. Thanks in advance. I am new with Matlab :-) On Feb 4, 10:06=A0am, "Jadda Suhaimi" <temba...@gmail.com> wrote: > Just wondering to how to calculate the rising time and falling time of an= evaporation graph. The axis are Resistance vs Time. Thanks in advance. > > I am new with Matlab :-) There are two steps: 1. Figure out how you can detect when data are rising and falling. 2. Code up that algorithm in Matlab. Before asking for help from th...

Counting the number of times a number turns up
I have 4 fields (byte) which can each contain a number between 1 and 40 odd.. The numbers in each of the fields represents the same information that can occur in one of 4 places. In each set of 4 (which would represent 1 record), each number can only occur in 1 of the 4 fields, it cannot be in the one record twice. I need a report that can tell me how many times each number occurs overall (in either field 1, 2, 3 or 4. I cannot come up with anything that seems to work for me. Help Dixie wrote: > I have 4 fields (byte) which can each contain a number between 1 and 40 > odd.. ...

Getting number of ones in a number in compile-time
I wrote the following code to get number of ones in a number in compile-time. Calling function is static_get_number_of_ones<std::size_t, 17>(). static_get_number_of_ones<int, 17>() static_get_number_of_ones<long, 17>(). I would like the static_get_number_of_ones() function to have default value for typename T, but 'typename T' is first in the list of arguments. Is it possible to do that in other way? // ----------------------------------- #include <iostream> template <typename T, T N, int S = sizeof(T) & CHAR_BIT> struct static_number_of_ones { ...

Searching for certain number withing series of numbers
We have a database that contains certificates for a certain type of equipment that we use, called slings (I don't know what it is either but we use it :-) Each "sling" have a serial number, however one certificate will cover a whole series of slings, so on the certificate, it will say that it covers from serial number xxxxxx to serial number yyyyyy. In each document, there's a SerialNumberFrom and a SerialNumberTo field containing the numbers covered by the certificate, ie. SerialNumberFrom = 2000 and SerialNumberTo = 2999. Now, when one of the slings are ...

Time within a number of minutes of a target time
I've got a mental block on how to do this. I have a date column on a table and I want to get rows where the time is within a certain number of minutes of a target time. e.g. where to_char(startdatetime,'HH24:MI') between targettime-window and targettime+window and this needs to work over a 24 hour clock. Maybe, it's intervals I need to be working with? Sorry - should point out that the targettime is not a date - just a time There is probably a better way but this came to mind: Calculate the time of day in seconds and figure out the high and low values fo...

Rise time/fall time for Spartan3 clock inputs
Hi there, I am encountering a strange problem in a state machine using a 33M3333 clock in a Spartan3 FPGA. >From time to time, the state machine misbehaves. The problem has at first been attributed to a relatively poor waveshape of the clock line. A load of 100ohms/10pF in series to ground has been put at the end of the line, improving a bit the problem. However, the problem is still there. I am now suspecting a too slow rise time or fall time of the clock input to the FPGA, that could let a noise go through around the threshold point. This idea is backed up by the fact that extra edges ...

Python and real-time OS timing/task communication?
Has anyone used Python and a hard real-time OS/patch to schedule timed events? We have started in on Debian and RTAI, and may be using LXRT. (I've been reading http://people.mech.kuleuven.be/~psoetens/lxrt/portingtolxrt.html) I was envisioning that we really only need a separate RT-process in C using RDTSC or ACPI clocking that can get its control messages from non-RT Python every 50ms or so, to toggle pins on parport0. Any pointers, examples, etc for communicating from Python to an RT task? Thanks, Ray Hi, Ray Schumacher wrote: > Has anyone used Python and a hard real-time OS/patch...

Web resources about - WinSetCp() falls over after a certain number of times - comp.os.os2.programmer.misc

Resources last updated: 1/31/2016 2:49:45 AM