Easy Way to Tell if Your Plug-in is Running in AIMcc 1.3 or Later
The other day I was working on the CoreWitness plug-in in order to prepare it for use with the latest AIM SDK, version 1.3.0. I quickly ran into the issue of what to do when it’s loaded in a client running a previous version of AIMcc.
The first clue came when I ran the client to debug some of the new CoreWitness code. The release notes in AIMcc indicated that a new property, called AccSessionProp_Pause, was added to IAccSession. I started my test run the way I always do by running AIM 6.1, but that client is using the older AIMcc 1.2.4.
Here was what I saw when looking at that property from the CoreWitness trace:
{Unknown} = {Empty}
hr=E_INVALIDARG 0x80070057 (2147942487U) (-2147024809L)
“{Unknown}” is shown because “AccSessionProp_Pause” is not in the typelib of the older AIMcc version that loaded the plug-in. The encouraging news is you get E_INVALIDARG.
Reading this property in AIMcc 1.3.0 shows:
AccSessionProp_Pause = {Empty}
hr=E_INVALIDARG 0x80070057 (2147942487U) (-2147024809L)
Wait, they both return E_INVALIDARG? This must be a write only property. OK, so this won’t work for this property. I could try to set the AccSessionProp_Pause to false, but that might have some unwanted effects. Another thing I could do is inspect the typelib to see if it knows about AccSessionProp_Pause, but I will save that as a last resort. Are there any other new readable properties?
The release notes mentioned another new property; this one is in the IAccPluginInfo interface called AccPluginInfoProp_Windows. Lets, see what it looks like from CoreWitness in AIMcc 1.2.4 and then in 1.3.0:
{Unknown} = {Empty}
hr=E_INVALIDARG 0x80070057 (2147942487U) (-2147024809L)
and
AccPluginInfoProp_Windows = {Empty}
BINGO, that’s exactly what what we need. We can simply adjust our logic based on the support of the AccPluginInfoProp_Windows property. In CoreWitness, I use this method to filter out what data I show and add more command actions when running under AIMcc 1.3.0 since this version lets me specify where these menu items go in the UI.