delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/10/28/21:12:41

From: andrei-i AT akdi DOT ru (Andrey I. Iliev)
Subject: Problem with CharLower function
28 Oct 1997 21:12:41 -0800 :
Message-ID: <01bce3d0$b3a0e4e0$e216e2c2.cygnus.gnu-win32@andrei-i.sv.akdi.ru>
Mime-Version: 1.0
To: <gnu-win32 AT cygnus DOT com>

Hi,
I have a problem with CharLower function. Here is the test code:

#include <windows.h>
#include <Windows32/Functions.h>
#include <stdio.h>
int main(int ac, char **av)
{
    LPTSTR ptr;
    LPSTR str1="QWERTY";
    LPSTR str2="qwerty";
    DWORD nBytes=1;
  printf("This is the original string: %s\n",str1);
  ptr=CharLower(str1);
  printf("This is the converted string: %s   %s\n",str1,ptr);
  printf("It shoud be equal to: %s\n",str2);
    if ( (nBytes=CharLowerBuff(str1,(DWORD)6)) != 6 )
    {
        printf("Error on CharLowBuff(), converted %i\n",nBytes);
    }
  printf("After CharLowerBuff: %s\n",str1);
    
}

Compile:
gcc -o test.exe test.c -dWIN32 -luser32

Running test.exe gives:

This is the original string: QWERTY
This is the converted string: QWERTY   (null)
It shoud be equal to: qwerty
Error on CharLowBuff(), converted 0

Does anybody know what is going on?

Iliev Andrei







-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019