Sorry for the minor mistake in my previous reply:
DBObject's AcadObject property is actually returns an object of "object"
type, not "AcadObject" type, although the property is named AcadObject. So,
you need explicitly cast it as AcadObject before assigning it to an
AcadObject variable:
Autodesk.AutoCAD.Interop.Common.AcadObject Obj =
(Autodesk.AutoCAD.Interop.Common.AcadObject) e.DBObject.AcadObject;
As for Error2, in your original post, the VB function has only one argument,
have you re-written the VB DLL but forgotten to update the reference?
wrote in message news:5409039@discussion.autodesk.com...
Hi Norman,
My function in VB look like below
Public Function GetObjFromParent(Fname as String, Obj As AcadObject)
' My Stuff
End Function
My function in C#.Net look like this
public void objAppended(object o, ObjectEventArgs e)
{
DemoProject.DemoClass DP= new DemoProject.DemoClass();
string Fname = "E:\\New Demo\\Demo.xml";
Autodesk.AutoCAD.Interop.Common.AcadObject Obj = e.DBObject.AcadObject;
DP.GetObjFromParent(ref Fname,ref Obj );
}
Error1: Cannot implicitly convert type 'object' to
'Autodesk.AutoCAD.Interop.Common.AcadObject'. An explicit conversion exists
(are you missing a cast?).
Error2: No overload for method 'GetObjFromParent' takes '2' arguments
Hope this clearly explains my problem.
Regards,
Basha