Re: copymemory basic question
- From: "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 26 Aug 2005 16:02:28 +0100
I hope not Sam. I'm implicitly saying that I've used CopyMemory to move
strings (and string pointers), and it does work. Plus there is no character
set translation involved. If it doesn't work for the OP then his declaration
of CopyMemory must be wrong.
Tony Proctor
"Sam Hobbs" <samuel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uT8fdrkqFHA.240@xxxxxxxxxxxxxxxxxxxxxxx
> I think you are saying the same thing that the author is saying except
with
> different words.
>
>
> "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
> news:eyZXGJiqFHA.3404@xxxxxxxxxxxxxxxxxxxxxxx
> > 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
- From: mscir
- Re: copymemory basic question
- References:
- copymemory basic question
- From: mscir
- Re: copymemory basic question
- From: Sam Hobbs
- Re: copymemory basic question
- From: Tony Proctor
- Re: copymemory basic question
- From: Sam Hobbs
- copymemory basic question
- Prev by Date: Re: Connecting to the Internet
- 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
|