.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LinkPath property of the Ole2Frame class: throws an Exception.

1 REPLY 1
Reply
Message 1 of 2
Anonymous
340 Views, 1 Reply

LinkPath property of the Ole2Frame class: throws an Exception.

Hi!

I'm writing an application that scans in dwg files if there is any OLE object like xls. I need to get the path of this file. To achieve it I use the LinkPath property of the Ole2Frame class, but this throws an Exception.

I post a part of my application code:

Transaction tr = doc.TransactionManager.StartTransaction();
using (tr)
{
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(btrId,OpenMode.ForRead);
foreach (ObjectId entId in btr)
{
Entity ent = tr.GetObject(entId, OpenMode.ForRead) as Entity;
if (ent != null)
{
Ole2Frame ole = ent as Ole2Frame;
if (ole != null)
{
ed.WriteMessage(ole.LinkPath.ToString());
}
}
}
tr.Commit();
}
----

The Exception information are: address error: 0x79e832f3, thread 0x1570. Error code: 0xc0000005

Can someone help me??
Thanks!!
Marco
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous


There's known bugs in the Ole2Frame.

 

In AutoCAD 2008, if you try to access one and the linked
object

or file is not present, it will terminate
AutoCAD.

 

IOW, the entire feature is unusable from
size=2>the API.


 

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009

href="http://www.acadxtabs.com">http://www.acadxtabs.com

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi!


I'm writing an application that scans in dwg files if there is any OLE
object like xls. I need to get the path of this file. To achieve it I use the
LinkPath property of the Ole2Frame class, but this throws an Exception.


I post a part of my application code:

Transaction tr =
doc.TransactionManager.StartTransaction();
using (tr)
{

BlockTableRecord btr =
(BlockTableRecord)tr.GetObject(btrId,OpenMode.ForRead);
foreach (ObjectId
entId in btr)
{
Entity ent = tr.GetObject(entId, OpenMode.ForRead) as
Entity;
if (ent != null)
{
Ole2Frame ole = ent as Ole2Frame;

if (ole != null)
{
ed.WriteMessage(ole.LinkPath.ToString());
}

}
}
tr.Commit();
}
----

The Exception information
are: address error: 0x79e832f3, thread 0x1570. Error code: 0xc0000005


Can someone help me??
Thanks!!
Marco

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost