Re: copymemory basic question
- From: "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 26 Aug 2005 10:41:00 +0100
If CopyMemory is used properly then there is no character set translation
involved at all. It's a generic API for moving amorphous memory, i.e. bytes
of data. The API itself doesn't care what the data is, and treats it
literatim. Hence, if any ANSI conversion is being done then it's because the
API declaration is wrong.
Tony Proctor
"Sam Hobbs" <samuel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eZwFZQaqFHA.3524@xxxxxxxxxxxxxxxxxxxxxxx
> "mscir" <mscir@xxxxxxxxx> wrote in message
> news:qL-dncH8AMmQhZDeRVn-gA@xxxxxxxxxxxxxxxxx
> >
> > Actually, you might think that the code:
> >
> > CopyMemory lng, s, 4
> >
> > would also work, but it doesn't. In brief, the reason is that when VB
sees
> > that a string is being passed to an API function, it makes a copy of the
> > array in ANSI format (rather than Unicode) and passes the ANSI version
to
> > the function. (For a more detailed discussion of this issue, please see
my
> > book.)
>
> It works, but the string gets converted to ANSI in the process. So "it
> doesn't" just means that the string loses non-ANSI characters.
>
>
.
- Follow-Ups:
- Re: copymemory basic question
- From: Sam Hobbs
- Re: copymemory basic question
- References:
- copymemory basic question
- From: mscir
- Re: copymemory basic question
- From: Sam Hobbs
- copymemory basic question
- Prev by Date: Re: copymemory basic question
- Next by Date: Re: Problem using NetServerGetInfo on x64 platform
- Previous by thread: Re: copymemory basic question
- Next by thread: Re: copymemory basic question
- Index(es):
Relevant Pages
|