Category : OS/2 Files
Archive   : EMXTST8F.ZIP
Filename : MSGTEST.C
#include
#include
#include
#define INCL_DOSMISC
#include
int main (int argc, char *argv[])
{
ULONG rc, len;
char text[512];
unsigned char buf[512];
int i, j;
USHORT count, codepage;
ULONG lang;
rc = DosGetMessage (argv, 1, text, sizeof (text), 1, "msgtest.msg", &len);
if (rc != 0)
{
fprintf (stderr, "DosGetMessage failed, rc=%lu\n", rc);
return (1);
}
if (len >= sizeof (text))
--len;
text[len] = 0;
puts (text);
#if 0 /* does not work */
rc = DosQueryMessageCP (buf, sizeof (buf), "msgtest.msg", &len);
if (rc != 0)
{
fprintf (stderr, "DosQueryMessageCP failed, rc=%lu\n", rc);
return (1);
}
i = 0;
while (i < len)
{
count = *(USHORT *)&buf[i]; i += sizeof (USHORT);
printf ("Code pages:");
for (j = 0; j < count; ++j)
{
codepage = *(USHORT *)&buf[i]; i += sizeof (USHORT);
printf (" %d", codepage);
}
lang = *(ULONG *)&buf[i]; i += sizeof (ULONG);
printf (" language=%lu\n", lang);
}
#endif
return (0);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/