Custom DragItems and windows

I am trying to create a subclass of DragItem that can handle a drag and drop of a class from a container control to a window in my program. The class is a custom class which inherits another custom class that inherits from object. I am trying to enable to drop of the DragItem into the window, but I have not been able to figure out how. I have tried changing the property of the DragItem to be a variant, but to no avail. With a text DragItem I can use the window.AcceptTextDrop method to enable moving text from a textfield to the window. Is there a similar method I am missing that will help me? If this was already discussed and I couldn’t find it, it would be great if someone pointed me in the right direction. Thanks!

Would anyone be able to help here? Not being able to drag and drop is preventing me from moving forward with my app.

I have a diagramming app where the user drags “objects” from a palette to the drawing area. These could be text, shapes (which are an object class), simple lines, or points on a curve.

when I select an object to be dragged… I create a DRAGITEM with the TEXT property set to a key value indicating what I’m dragging

when I drop it, that key is decyphered and the true object is then displayed, created, moved depending on the situation.

So just use a dictionary of the possible classes and look up the related class with a text keyword? Sounds easy enough. I was thinking of using a dictionary but I don’t have much experience with them so I wasn’t sure if this would be an efficient use or if there would be a better way. Thanks.

PS. What if I wanted to move something that was already placed? Add an entry to the dictionary with the instance already placed class, then delete the instance, then create the dragitem and finally place it, recreate the class and delete the dictionary reference to it? It seems to me like a better way would be to merely change the left and top coordinates of the object with the mousedrag event on the window?