How do I serialize/deserialize Visio master to/from a stream?
How this is implemented in ShapeStudio?
Look at XML in the Visio help and SDK.
Regards, Paul Herber, Sandrila Ltd.
Electronics for Visio http://www.electronics.sandrila.co.uk/
> Look at XML in the Visio help and SDK.
Please, can you be more concrete?
I know, XML and open formats are great, but what relation does it have
to my question..?
I do NOT want to generate masters/drawings with XML... this is NOT the
I want to persist already existing masters (created by users).
Just like the ShapeStudio does.
(it persists masters to the database, in table "Masters" as BLOBs)
How can XML help here?
Kind regards, Nikolay K. Belyh
- Query master or shape you want to persist for IDataObject interface.
- Using this interface, obtain data blob in "Visio 11 Shapes/Visio 11
Masters" clipboard format (for Visio 2003).
Now this blob can be stored any way you want (database/memory/
To drop it back to the drawing, you can use "Drop" functions of visio
It turns out that these functions are happy enough with IDataObject
interface passed in.
So, to drop the stored master or shape back to the drawing:
- Create you own object that implements IDataObject interface.
- Pass this object in one of those "Drop" functions,
- When asked for the data, return your stored data blob in that visio
It works :)
But maybe there is an easier way to do all this stuff?