Re: Pointer to a Unicode string - returned by API call



Lester wrote:
Now MIB_IFROW has a member wszName [MAX_INTERFACE_NAME_LEN] which is a
"Pointer to a Unicode string that contains the name of the interface".
How do I read this out from the memory, and put in (eg.) a TStrings?

Exactly the way you've done it. Although to avoid potential data loss, I'd use a list of WideStrings instead of a list of AnsiStrings.


        //PROBLEM HERE: MibRow.wszName is EMPTY!!!???
        ListInterfaces.Add('name: ' + MibRow.wszName);  // <-- HOW TO
READ IT???

That's the way to do it. What does the debugger tell you are the contents of the wszName field? Could it be that the field is indeed empty?


--
Rob
.