Real Software Forums
http://forums.realsoftware.com/

REALGetVariantStructure?
http://forums.realsoftware.com/viewtopic.php?f=5&t=45948
Page 1 of 1

Author:  dbronson [ Fri Nov 16, 2012 11:24 am ]
Post subject:  REALGetVariantStructure?

Sorry if this sounds doltish, but is REALGetVariantStructure meant to help get the raw bytes of a variant, or not? If so, according to the documentation, I apparently need to allocate a buffer for this data to be copied into, correct? How do I figure out the size I'd need? How does one get the size of a REALObjectStruct? Or am I thinking about this wrong?

Author:  MonkeybreadSoftware [ Fri Nov 16, 2012 11:32 am ]
Post subject:  Re: REALGetVariantStructure?

REALGetVariantStructure is for getting structures.

But I never used it myself.

Greetings
Christian

Author:  dbronson [ Fri Nov 16, 2012 11:38 am ]
Post subject:  Re: REALGetVariantStructure?

Hmm. So perhaps I'm thinking about this wrong. As an experiment, as part of a larger scheme, I was trying to read the raw data in the variant into a byte buffer, then construct a new variant from that using REALNewVariantStructure, the result being a copy of the original variant.

It almost works, but for the lack of size info with which to allocate a buffer. Perhaps I'll have to re-think the whole premise.

Author:  dbronson [ Fri Nov 16, 2012 11:44 am ]
Post subject:  Re: REALGetVariantStructure?

Actually, no. It works even less well than I had thought. The resulting "copy" shows up with type = 36, indicating a structure as you said. This is clearly not something I should be doing.

Author:  MonkeybreadSoftware [ Fri Nov 16, 2012 11:44 am ]
Post subject:  Re: REALGetVariantStructure?

a copy? Why? Normally you just retain or release it as you carry it.

Greetings
Christian

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/