Re: copymemory basic question



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.
> >>
> >>
> >
> >
>
>


.



Relevant Pages

  • Re: How the Other Half Writes: Otto Schumann: Schreibkunst
    ... 'Who' as in a character or more I ... labourer working in the evil overlord's garden with a visitor trampling ... Fiction is a TERRIBLE vehicle for saying things, ... In the ME, same-sex relationships are so much not an issue, they don't ...
    (rec.arts.sf.composition)
  • Re: copymemory basic question
    ... The beginning was Tony saying: ... I was not disagreeing with Tony. ... > I've used CopyMemory to move strings, ... > I think that the point of the "Lightning Strings" article (as referred to ...
    (microsoft.public.vb.winapi)
  • Re: copymemory basic question
    ... The beginning was Tony saying: ... I was not disagreeing with Tony. ... used CopyMemory to move strings, ... As for "character set translation", Tony said "Plus there is no character ...
    (microsoft.public.vb.winapi)
  • Re: copymemory basic question
    ... The beginning was Tony saying: ... I was not disagreeing with Tony. ... > used CopyMemory to move strings, ...
    (microsoft.public.vb.winapi)
  • Re: Must all Mormons believe the same set of dogma? (Was about
    ... they must have trouble explaining it to the rest of us. ... whatever I seem to you to be saying is what you are going to ... He may never have changed in character or purpose etc. ... Do you consider Jesus Christ to be in some way that unchangable God? ...
    (soc.religion.mormon)