CRhinoDialog::DoModal() Rhino 5 win32 returns -1


#1

Hi,
I’m updating a digitizer plug-in to Rhino 5 SDK. The x64 version works flawlessly.

The win32 version does not. The digitizer functions work fine, but dialog boxes cannot be displayed.

In OnPlugInMenuCommand() we instantiate and display dialogs derived from CRhinoDialog.
The call to DoModal() returns -1 and the dialog is never displayed.

Has anyone had this experience?

The project is built against Rhino 5.0 SDK\lib32\Rhino4.lib.

I am running Rhinoceros 5 90-Day Evaluation win32 version on Win7 x86.

Thanks,
Suzanne


(Dale Fugier) #2

Hi Suzanne,

Since you are loading a resource (to create your dialog), make sure you throw a

AFX_MANAGE_STATE(AfxGetStaticModuleState( ));

statement in before creating your dialog.


#3

Hi Dale,
Thanks for the reply.
The AFX_MANAGE_STATE( AfxGetStaticModuleState() ) call does appear at the top of the OnPluginMenuCommand() method.

This code has not been changed in our rebuild against Rhino 5 SDK. It worked previously with Rhino 4 (win32) and it works now with Rhino 5 x64.

Any other ideas?

Thanks,
Suzanne


(Dale Fugier) #4

Hi Suzanne,

How did you generate your V5 plug-in project? Did you use the wizard that comes with the Rhino 5 SDK?

Can you provide source code to something that does not work for you? Feel free to email me directly at dale@mcneel.com.