PreTranslateMessage in Modeless dialog

Dear all, I have a plugin having a modeless dialog and want to handle the Pretranslate message. Compiling the plugin for Rhino 5 has no problems, but with Rhino 6, I don’t get these messages.I have tried to add #define RHINO_SDK_MFC, but still cannot get it.
Do you have any idea what is wrong? Can you give me a small plugin example for v6 where the messages are handled in this modeless dialog?

Thank you in advance.

This is a problem with modeless MFC dialog boxes in a DLL and is well documented on MSDN. We had some code to work around this in Rhino 5 that appears to be broken in the current Rhino 6 builds. I’m investigating this now to see what is happening.

After further investigation I was able to make this work. You must derive your dialog from CRhinoDialog for it to work which allows core Rhino to forward the PreTranslateMessage. I have attached a sample plug-in I used for (68.1 KB)

@JohnM is there a way to do this without forcing a class to be derived from CRhinoDialog? Forcing derivation of CRhinoDialog ties a plug-in’s MFC version to the same one that Rhino uses.

Thank you John. I tested and your example works. So may be my plugin has messed up the implementation. As long as I have a working example, I believe I will sort out mine.