View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default CopyMemory - Array of UDTs referenced as a pointer to a string

Sorry I just re-read your question. In C there is no such thing as a string.
There is only a null terminated array of characters. When you de-reference
the pointer to the arry you get the string. In C the de-reference retrieves
all characters up until Null or ASCII Z is returned.

"Mark Stacey" wrote:

Data is sent to me by an API which returns a pointer to a "string" which
is actually a data structure. I use CopyMemory(Alias RtlMoveMemory) to
get access to this data in my own UDT's.
My problem arises in that sometimes the data will be returned as an
array of structs. The API doesn't provide for letting me know the size
of the array, and getting the length of the string just gives me the
length of one element.
The API is not written in VB, so I think that means it's a
null-terminated array, if so how do I copy each of the elements in my
own array of equivalent structure?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!