How to draw interactively a line on a layer?

Could you show me an example of code to get the positions of user clicks (two points) on map in order to draw then a line ? I suppose I have to use SHP_POLYLINE as shapefile type and “AddShape” as cursor mode. But I don’t succeed to draw interactively a line on the created layer.

(Morever, I would like to create a point/arrowhead with the good rotation on a second layer at the end of this segment as jerryfaust suggested here : https://github.com/MapWindow/MapWinGIS/issues/122)

Thank you in advance for your help
Gilles

If you want to draw on an existing layer you can use the Shape Editor
or look at this example ‘Add points to map’.

If you want to draw on another layer you can use Drawing layers. Drawing layers don’t have an option to draw an arrowhead but you can create one using DrawPolygonEx().

Hj pmees. Currently, I am writing code to add and edit shape using shapeEditor. However, I have not used shapeEditor. Can you help me?. if you had an example about it. Can you give me. Thanks a lot

Sorry for the late reply.
Are you still locked?

The example I was talking about is the link in my previous comment.