Re: copymemory basic question



I think Stoil has answered this on my behalf Sam [thanks Stoil]. However,
just to close the loop:

Yes, I know there is a character set translation involved if an API argument
is declared as a String - most of us are aware of that. However, we were
specifically talking about CopyMemory in this thread. What I was saying is
basically that CopyMemory should not be declared with any arguments typed as
String. Its source and destination pointers are just raw virtual memory
addresses, and could point to anything you want. Hence, there should be no
character set translation in calling this specific API. If there is, then
the declaration of the CopyMemory API is in error.

Tony Proctor

"Sam Hobbs" <samuel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ey7e90oqFHA.1032@xxxxxxxxxxxxxxxxxxxxxxx
> "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
> news:%23m0eu8kqFHA.3540@xxxxxxxxxxxxxxxxxxxxxxx
> >I hope not Sam. I'm implicitly saying that I've used CopyMemory to move
> > strings (and string pointers), and it does work.
>
> The author also uses CopyMemory.
>
> > Plus there is no character set translation involved.
>
> Are you saying that the author of the book is incorrect? Are you saying
that
> strings are never converted to ANSI when an ANSI function in a DLL is
> called?
>
> > If it doesn't work for the OP then his declaration
> > of CopyMemory must be wrong.
>
> Are you saying that the declaration of CopyMemory used by the author is
> wrong? Note that the author provides a sample use of CopyMemory that
causes
> the string to be converted to ANSI. You seem to be saying that the reason
> the string is converted to ANSI is that the declaration of CopyMemory that
> is used is wrong.
>
>


.



Relevant Pages

  • Re: copymemory basic question
    ... acknowledge that the default CopyMemory declaration uses 'Any' but I ... consider this to be a bug (certainly not the first in the API Text Viewer). ... > is declared as a String - most of us are aware of that. ...
    (microsoft.public.vb.winapi)
  • Re: copymemory basic question
    ... I'm implicitly saying that I've used CopyMemory to move ... >> strings, ... > Are you saying that the declaration of CopyMemory used by the author is ...
    (microsoft.public.vb.winapi)
  • Re: copymemory basic question
    ... > strings, ... The author also uses CopyMemory. ... Are you saying that the author of the book is incorrect? ... strings are never converted to ANSI when an ANSI function in a DLL is ...
    (microsoft.public.vb.winapi)
  • Re: copymemory basic question
    ... > strings, ... The author also uses CopyMemory. ... Are you saying that the author of the book is incorrect? ... Are you saying that the declaration of CopyMemory used by the author is ...
    (microsoft.public.vb.winapi)
  • 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)

Loading