ForeignData Tag and OLE

L

lucoosa

I am trying to intrepret the OLE data that is stored in a ForeignData tag in
terms of pulling out the metafile and the native OLE data. Does anyone have
information on the MIME BLOB that is stored in an XML vdx file for OLE
embedded data in the ForeignData tag?
 
C

Chris [Visio MVP]

The Visio developer help has the info I've pasted below, if you haven't
found it: I haven't tried to extract the info yet, and I don't know if the
info below gives enough information for you to rebuild the objects.

--
Hope this helps,

Chris Roth
Visio MVP

--------------------------------------------------------------

ForeignData Element

Contains a MIME (Multipurpose Internet Mail Extensions) encoded BLOB of
picture data, such as Windows metafile, bitmap, or OLE data.


Syntax
<ForeignData
ForeignType
[ObjectType]
[ShowAsIcon]
[ObjectWidth]
[ObjectHeight]
[MappingMode]
[ExtentX]
[ExtentY]
[CompressionType]
[CompressionLevel]>
</ForeignData>Attributes
ForeignType

Required enumeration.

Value Description
4
Object

16
Metafile

32
Bitmap


ObjectType

Optional int. If the ForeignType attribute is "Object", the ForeignData
element must also have an ObjectType attribute. The ObjectType attribute is
an integer value that may be a sum of the following values.

Value Description
256
Linked object

512
Embedded object

1024
Control

16384
OLE2 Named

32768
OLE2 object



ShowAsIcon

Optional Boolean. This attribute is only meaningful if the foreign data is
an OLE2 embedded object.


Value Description
0
Do not show embedded data as an icon.

1
Show embedded data as an icon.


ObjectWidth

Optional float. This attribute is only meaningful if the foreign data is an
OLE2 embedded object. The value expresses the width of the object in page
units.

ObjectHeight

Optional float. This attribute is only meaningful if the foreign data is an
OLE2 embedded object. The value expresses the height of the object in page
units.

MappingMode

Optional int. This attribute is only meaningful if the foreign data is a
metafile. The value indicates the metafile mapping mode.

ExtentX

Optional float. This attribute is only meaningful if the foreign data is a
metafile. The value indicates the horizontal extent of the metafile.

ExtentY

Optional float. This attribute is only meaningful if the foreign data is a
metafile. The value indicates the vertical extent of the metafile.

CompressionType

Optional string. This attribute is only meaningful if the foreign data is a
raster-based foreign object, such as a DIB, JPG, PNG, TIFF, or GIF file. The
value indicates the type of compression applied to the file.

Value Description
0
No compression (the default)

1
JPEG compression

2
GIF compression

3
TIFF compression

4
PNG compression


CompressionLevel

Optional float. This attribute is only meaningful if the foreign data is a
raster-based foreign object, such as a DIB, JPG, PNG, TIFF, or GIF file. The
value indicates the level of compression applied to the file. Compression
level is measured in hundreths of a percent.

Element properties
Property Value
Name ForeignData
Minimum Occurrences 0
Maximum Occurrences 1

Element information
Parent elements

PageSheet

Shape

StyleSheet

DocumentSheet

Child elements

None

See also
ForeignData property

ForeignType property
 
L

lucoosa

Chris,

What I'm specifically looking for with this MIME data is how to intrepret
it. I am using c++ and MFC. Is three a corresponding class for this OLE
data? I understand the ForeignData tag and the values that are stored there
but if I want to actually do something with this OLE Binary Chunk of data
what exactly do I use from a C++ perspective to intrepret the binary chunk?
Is it structured storage? What exactly is it?

Chris said:
The Visio developer help has the info I've pasted below, if you haven't
found it: I haven't tried to extract the info yet, and I don't know if the
info below gives enough information for you to rebuild the objects.

--
Hope this helps,

Chris Roth
Visio MVP

--------------------------------------------------------------

ForeignData Element

Contains a MIME (Multipurpose Internet Mail Extensions) encoded BLOB of
picture data, such as Windows metafile, bitmap, or OLE data.


Syntax
<ForeignData
ForeignType
[ObjectType]
[ShowAsIcon]
[ObjectWidth]
[ObjectHeight]
[MappingMode]
[ExtentX]
[ExtentY]
[CompressionType]
[CompressionLevel]>
</ForeignData>Attributes
ForeignType

Required enumeration.

Value Description
4
Object

16
Metafile

32
Bitmap


ObjectType

Optional int. If the ForeignType attribute is "Object", the ForeignData
element must also have an ObjectType attribute. The ObjectType attribute is
an integer value that may be a sum of the following values.

Value Description
256
Linked object

512
Embedded object

1024
Control

16384
OLE2 Named

32768
OLE2 object



ShowAsIcon

Optional Boolean. This attribute is only meaningful if the foreign data is
an OLE2 embedded object.


Value Description
0
Do not show embedded data as an icon.

1
Show embedded data as an icon.


ObjectWidth

Optional float. This attribute is only meaningful if the foreign data is an
OLE2 embedded object. The value expresses the width of the object in page
units.

ObjectHeight

Optional float. This attribute is only meaningful if the foreign data is an
OLE2 embedded object. The value expresses the height of the object in page
units.

MappingMode

Optional int. This attribute is only meaningful if the foreign data is a
metafile. The value indicates the metafile mapping mode.

ExtentX

Optional float. This attribute is only meaningful if the foreign data is a
metafile. The value indicates the horizontal extent of the metafile.

ExtentY

Optional float. This attribute is only meaningful if the foreign data is a
metafile. The value indicates the vertical extent of the metafile.

CompressionType

Optional string. This attribute is only meaningful if the foreign data is a
raster-based foreign object, such as a DIB, JPG, PNG, TIFF, or GIF file. The
value indicates the type of compression applied to the file.

Value Description
0
No compression (the default)

1
JPEG compression

2
GIF compression

3
TIFF compression

4
PNG compression


CompressionLevel

Optional float. This attribute is only meaningful if the foreign data is a
raster-based foreign object, such as a DIB, JPG, PNG, TIFF, or GIF file. The
value indicates the level of compression applied to the file. Compression
level is measured in hundreths of a percent.

Element properties
Property Value
Name ForeignData
Minimum Occurrences 0
Maximum Occurrences 1

Element information
Parent elements

PageSheet

Shape

StyleSheet

DocumentSheet

Child elements

None

See also
ForeignData property

ForeignType property



--------------------------------------------------------------


lucoosa said:
I am trying to intrepret the OLE data that is stored in a ForeignData tag
in
terms of pulling out the metafile and the native OLE data. Does anyone
have
information on the MIME BLOB that is stored in an XML vdx file for OLE
embedded data in the ForeignData tag?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top