MemoryBlock to Structure?

Assuming that the MemoryBlock’s data matches that of the Structure, is there a way to force data from a MemoryBlock into a Structure so I can read it conveniently using the Structure?

dim s as MyStructure
s.StringValue( mb.LittleEndian ) = mb

Using StringValue there just doesn’t seem intuitive to me.

Thanks Kem!

You can use a ptr as well.

dim p as ptr = mb
dim s as myStructure = p.myStructure

Thanks Tim, thanks makes a little more sense, I can now use it without an intermediary variable, nice! (I’m passing it into a method)