Hello! I want to use ShapeEditor class to edit Shape (AddPoint, Edit vertices, Delete points), when call StarEdit() function, report error :Shape editor is not attached to a map
I don’t know how to attach a map, I didn’t find the attach method. This is my code:
Thank you @ jerryfaust . I see the AxMap.ShapeEditor property in the AxMap Class specification, However my map file is generated by OCX, and I don’t find the getShapeEditor function.
I found an older program in which I generated the interface using the Class Wizard. Sometimes the wizard doesn’t generate all available methods, and I don’t know why (perhaps when they are defined as LPDISPATCH instead of the specific type, which in this case is IShapeEditor). But they can usually be added manually.
I found these various references (from various files):
I hope this is helpful. For the work you’re doing, I would encourage you to download the source code for the OCX. In it, you can see the baseline definitions in the IDL file, and the source code used to attach to the methods.