Addin development - don't think it's possible...
-
I've been trying to write an addin in Visual Studio 2005 and am having endless problems - hopefully someone can tell me I'm not alone. It's a very basic addin and I'm using the builtin template as a starting point. Problems include: - breakpoints not being hit - addin not loading for some reason, but then loads again later, and then stop again... - previous addin attempts still load even though I think I've deleted them out of the addin folder I'm on the verge of giving up. All help on the internet on this point is not very helpful... Oh, and don't even get me started on the horrific object model you need to work with... S
Cheers, Simon > company:: Broken Keyboards Software > blog:: brokenkeyboards > skype :: SimonMStewart > CV :: PDF
-
I've been trying to write an addin in Visual Studio 2005 and am having endless problems - hopefully someone can tell me I'm not alone. It's a very basic addin and I'm using the builtin template as a starting point. Problems include: - breakpoints not being hit - addin not loading for some reason, but then loads again later, and then stop again... - previous addin attempts still load even though I think I've deleted them out of the addin folder I'm on the verge of giving up. All help on the internet on this point is not very helpful... Oh, and don't even get me started on the horrific object model you need to work with... S
Cheers, Simon > company:: Broken Keyboards Software > blog:: brokenkeyboards > skype :: SimonMStewart > CV :: PDF
Hi Simon A major source of confusion is the flags that are passed to your "connect" class. IIRC the addin template sets the OnConnection handler up to handle ext_ConnectMode.ext_cm_UISetup. This is only called once in the entire lifetime of your addin. Also you will find things like your menu items being dropped without warning, it can be quite a mess. One solution is to handle both ext_cm_Startup and ext_cm_AfterStartup and recreate your menu items at that stage - its probably acceptable if you only have a few items. You need to make sure you *dont* have your "... - For Testing" addin set to load on startup, as it will be loaded by your "development" visual studio instance, and it will break the build process. Also, get familiar with running:
devenv /resetaddin Complete.Name.Of.Your.Connect.Class
for use when things really get pear-shaped. Regarding the horrible object model - remember that you will need to handle "ArgumentOutOfRangeException" when accessing an indexed collection as they won't return null (technical reason is the COM interop marshalling an E_ code back becomes an exception back in managed land). Hrmmm. Theres lots of caveats actually, maybe I'll write an article when I get around to it - you are right that theres not much info out there. We had a lot of "fun" developing the Diamond Binding addin ;) Hope that helps,
Mark Churchill Director Dunn & Churchill
-
Hi Simon A major source of confusion is the flags that are passed to your "connect" class. IIRC the addin template sets the OnConnection handler up to handle ext_ConnectMode.ext_cm_UISetup. This is only called once in the entire lifetime of your addin. Also you will find things like your menu items being dropped without warning, it can be quite a mess. One solution is to handle both ext_cm_Startup and ext_cm_AfterStartup and recreate your menu items at that stage - its probably acceptable if you only have a few items. You need to make sure you *dont* have your "... - For Testing" addin set to load on startup, as it will be loaded by your "development" visual studio instance, and it will break the build process. Also, get familiar with running:
devenv /resetaddin Complete.Name.Of.Your.Connect.Class
for use when things really get pear-shaped. Regarding the horrible object model - remember that you will need to handle "ArgumentOutOfRangeException" when accessing an indexed collection as they won't return null (technical reason is the COM interop marshalling an E_ code back becomes an exception back in managed land). Hrmmm. Theres lots of caveats actually, maybe I'll write an article when I get around to it - you are right that theres not much info out there. We had a lot of "fun" developing the Diamond Binding addin ;) Hope that helps,
Mark Churchill Director Dunn & Churchill
Mark Churchill wrote:
maybe I'll write an article when I get around to it
Go ahead mate, I'll read it for sure.! Thanks for the input.
Cheers, Simon > company:: Broken Keyboards Software > blog:: brokenkeyboards > skype :: SimonMStewart > CV :: PDF