GetICustButton, GetICustEdit, not working

GetICustButton, GetICustEdit, not working

Anonymous
Not applicable
1,037 Views
7 Replies
Message 1 of 8

GetICustButton, GetICustEdit, not working

Anonymous
Not applicable
I'm almost up to speed on adding controls to a plugin's dialog box but when I call the Get functions in custctrl.h it never returns a valid pointer to a control. And I even checked to see if I was passing the right control handle to them. I call GetDlgItem beforehand and check to see that it doesn't return NULL. So I have the right handle. I'm going off the custctrl.cpp file to learn this, is there any extra initializing I need to do to the controls after they're dragged into the dialog box?
0 Likes
1,038 Views
7 Replies
Replies (7)
Message 2 of 8

istan
Advisor
Advisor

HWND h = GetDlgItem( WindowHandle, DlgCtlID );

ICustEdit * ed = GetICustEdit( h );

// CODE

ReleaseICustEdit( ed );

 

this is all which was always necessary..

0 Likes
Message 3 of 8

Anonymous
Not applicable
Right, but right in the middle there where // CODE is, the software crashes if I try to call any methods on the controls pointer. I'm using the Dialog box handle that is passed to its Dialog procedure in GetDlgItem, along with the ID stated in the property editor for the control I want to access, and it doesn't return NULL which means it's returning the valid handle for the control. There must be something I'm missing
0 Likes
Message 4 of 8

Anonymous
Not applicable

Weirdness! So I made a fresh new plugin and the original spinner and edit box that are already on the dialog box process perfectly fine. But if I add a second spinner & edit box, it once again crashes as soon as I invoke any methods on their pointers. Also in the dialog editor, the original spinner/edit are listed as "custom control", whereas the second ones I add are listed as "Edit Control" & "Spin Control" in the property editor. Could it be that I'm adding the controls to the dialog wrong?

0 Likes
Message 5 of 8

Anonymous
Not applicable

Finally figured it out. I gotta add the "Custom Control" control in the tools section of the dialog editor and type in it's class in the property page. 

0 Likes
Message 6 of 8

istan
Advisor
Advisor

of course do windows controls not have CustIControl interfaces.. at least as far as I know 😉

0 Likes
Message 7 of 8

Anonymous
Not applicable

I'm working with an old version of 3d max too which might have been relevant. I'm using 3D Max 9 and compiling with VS 2008

0 Likes
Message 8 of 8

istan
Advisor
Advisor

I also prefer using Max8 or 9 for sdk development.. unbelievable faster!! The CustUI stuff exists longer.. But since AD uses QT, some CustUI features behave different or do not even work anymore..

0 Likes