Am Sun, 20 Mar 2016 22:37:37 +0000 schrieb Vincent R <[email protected]>:
> Now I need to understand what the original author wanted > to do by declaring these 2 constructors. It reminds me of what other wrappers do. The second constructor pair is the proper one and takes the regular arguments to construct the object. Sometimes though you already got an object returned from C code and you merely want to wrap it. That's what the first constructor pair is for. You can see how the second pair of constructors always forwards to the first pair with a newly created wxTreeItemId expressed as an IntPtr. Maybe IntPtr should be a pointer to an opaque struct instead: struct WxObject; alias WxObject* IntPtr; That could resolve the current issue that 2 of the constructors take the same types of arguments, (void*). If this is the only place with this error, you can probably remove the 3rd and 4th ctor. From the manual: "A wxTreeItemId is not meant to be constructed explicitly by the user; only those returned by the wxTreeCtrl functions should be used." And taking a wild guess here without looking at the code, I assume TreeCtrl calls the 2nd ctor. -- Marco
