More magic with IDTToolsOptionsPage


I finally found some time to work on VisEmacsDotNet again. I spent a couple of days trying to get a custom options page to show up in the Tools | Options dialog. I had the dialog resources set up correctly, the correct values in the Addins registry hive and had even figured out how to generate an ATL dialog page. It seemed like everything was falling into place, but at 4:55pm on a Friday afternoon, you just know that something would go wrong. True to form, when I ran a new instance of devenv.exe and opened the Options dialog, the VisEmacsDotNet entry was not there.

Well, let me tell you why it wasn’t working. It turns out that my instance of the IDTToolsOptionsPage wasn’t registered. And why not? Well, it wasn’t in the object map. And just why was it not in the object map? Because I had commented out the OBJECT_ENTRY_AUTO macro invocation. I did that because I was getting linker errors — the IID and CLSID of my class were undefined.

Hold your exclamations of disbelief! I swear I was getting these errors from wizard code. Truly! I went through every line and setting of the RegExplore sample looking for the source of its magic but wasn’t able to discern its wizardry. Since there is more than one way to skin this particular cat…. I went back to VisEmacsDotNet and did the dastardly deed…I #include‘d Addin_i.c directly into Addin.cpp. After rebuilding the solution, I ran devenv again and there was one spiffy looking options page.

If anyone is reading (and I know there are at least two of you out there who are) that knows the Way Of The Interface and can explain to me why I had to include the Addin_i.c file directly instead of having it magically referenced by the project, I’d really appreciate it.

Comments are closed.