*******code from Esri*************
Dim pMemoryBlobStream As IMemoryBlobStream
Set pMemoryBlobStream = New MemoryBlobStream
Dim pObjectStream As IObjectStream
Set pObjectStream = New ObjectStream
Set pObjectStream.Stream = pMemoryBlobStream
Dim pPersistStream As IPersistStream
Dim pPageLy as iPageLayout
Set pPageLy = pMxDoc.PageLayout
Set pPersistStream = pPageLy
'page layout implements ipersiststream only
pPersistStream.Save pObjectStream, False
pMemoryBlobStream.SaveToFile “C:/Temp/MyFile.blb”
'ipagelayout object is saved to a file
'**now I could also retrieve the object from the file
like this ***'
dim pPageLy1 as iPageLayout
set pPageLy1 = new PageLayout
Dim pObjectStream As IObjectStream
Set pObjectStream = New ObjectStream
Dim pMemoryBlobStream As IMemoryBlobStream
Set pMemoryBlobStream = New MemoryBlobStream
pMemoryBlobStream.LoadFromFile “C:/Temp/MyFile.blb”
Dim pPersistStream As IPersistStream
Set pPersistStream = pPageLy1
Set pObjectStream.Stream = pMemoryBlobStream
pPersistStream.Load pObjectStream
'this would create new page layout object
AE 序列化
最新推荐文章于 2023-02-04 16:57:02 发布