what is Error (CS1752 Interop type 'PointClass' cannot be embedded. Use the applicable interface instead.)

3937
2
Jump to solution
06-22-2017 11:13 AM
HushamMohamed
Occasional Contributor

I am trying to update my Addin  from ArcObject 10.3 to 10.5 using VS2015  .net 5.2 Frame work  but I am getting  Error

CS1752:  CS1752 Interop type 'PointClass' cannot be embedded. Use the applicable interface instead.)

 // Get selected line segments end points
 pPolyline = pFeature.Shape as IPolyline;
 IPoint pOutPoint = new PointClass();
 // Convert screen coordinates to Map coordinates
 //pPoint = ;
 pMxApp = pApp as IMxApplication;
 pPoint = pMxApp.Display.DisplayTransformation.ToMapPoint(X, Y);  

and same Error here as  Well.

//Get normal
 ILine pTangent = new LineClass();
 pPolyline.QueryTangent(esriSegmentExtension.esriExtendTangentAtFrom, FromDist, false, 100.0, pTangent);

I do appreciate any help or hint

Husham

0 Kudos
1 Solution

Accepted Solutions
HushamMohamed
Occasional Contributor

Thank you Sean,  I found that just Removing the suffix Class  solve  the Problem..

// Get selected line segments end points
 pPolyline = pFeature.Shape as IPolyline;
 IPoint pOutPoint = new Point();
 // Convert screen coordinates to Map coordinates
 //pPoint = ;
 pMxApp = pApp as IMxApplication;
 pPoint = pMxApp.Display.DisplayTransformation.ToMapPoint(X, Y);  

//Get normal
 ILine pTangent = new Line();
 pPolyline.QueryTangent(esriSegmentExtension.esriExtendTangentAtFrom, FromDist, false, 100.0, pTangent);

View solution in original post

0 Kudos
2 Replies
by Anonymous User
Not applicable

Check that Embed Interop Types is set to False for your ESRI assembly references. Its set to True by default when you add them in VS.

HushamMohamed
Occasional Contributor

Thank you Sean,  I found that just Removing the suffix Class  solve  the Problem..

// Get selected line segments end points
 pPolyline = pFeature.Shape as IPolyline;
 IPoint pOutPoint = new Point();
 // Convert screen coordinates to Map coordinates
 //pPoint = ;
 pMxApp = pApp as IMxApplication;
 pPoint = pMxApp.Display.DisplayTransformation.ToMapPoint(X, Y);  

//Get normal
 ILine pTangent = new Line();
 pPolyline.QueryTangent(esriSegmentExtension.esriExtendTangentAtFrom, FromDist, false, 100.0, pTangent);
0 Kudos