Getting size of class
I'm trying to determine shallow size of some class, I mean corresponding System.Type's instance size. Unfortunately I've got only ClassID of given class and using GetObjectSize function with ClassID as a parameter causes crash. Maybe there is a way to obtain ObjectID of needed System.Type's instance?
Thanx
I've toyed with methods for getting the size of simple objects (as of yet I have found no good way to do this for more complex types short of marking them as MBR and using the method mentioned above). my interest has been in pinning the object and zeroing its memory (this need has largely been eliminated by the SecureString class)
here is what I have for simple types (hopefully it points you in the right direction)
http://stand__sure.aspfreeserver.com/sizeof/utility.vb.html