The problem -- IMHO an NT bug -- is that NT calls the AddOn's constructor three times. I haven't the faintest idea why it needs more than one copy, but NT thinks it does.
- It uses instance #1 to get everything initialized. One of the things that happens there is that event callbacks get registered within my code.
- I have no idea what instance #2 ever gets used for.
- Then it delivers the virtual function calls for window creation to instance #3. The problem is that instance #1 has the callback registrations. As far as instance #3 knows, nothing was ever registered.
IMHO NT has absolutely no business calling into a freshly-constructed instance #3. I might be able to see it if instance #3 had come from cloning, but that's not what NT does. IMHO this is a big bug.
In my case there is a pretty straightforward workaround -- I made all interesting values static. That is obviously not satisfactory in general, though. If NT really does need multiple objects it had better clone them at an appropriate time, such as just before using them. Simply substituting a constructed object without the operational history is a non-starter. Please fix.
--EV
Comment