Versioning of COM interfaces
I'm not sure what the appropriate things to change are in terms of
versioning when you update your COM server.
I've added a couple new interfaces to my COM classes. I tried to update my
version from 1.0 to 1.1, but when I did VBScripts could no longer create my
object (I have an out-of-proc COM server). VB6 also seemed a bit confused
and could not see the new interfaces (though it could still create and use
the object, using the old interfaces, unlike VBScript).
I thought that I should change the IDL as follows:
[
uuid(49A23555-5555-4955-8D55-8E4F56FCB555),
version(1.1),
helpstring("MyCompany Product 1.1 Type Library")
]
library PRODUCTLib
{
importlib("stdole2.tlb");
There are only a few places in the IDL where a version can even be
specified. I also changed this line in my applications CMyApp.cpp file:
[ module(unspecified, uuid = "{49A23555-5555-4955-8D55-8E4F56FCB555}",
helpstring = "PRODUCT 1.1 Type Library", name = "PRODUCTLib") ];
This looks to only be a help string though.
Lastly, and probably most importantly, I changed the classes that implement
the interfaces as such:
public IDispatchImpl<IMyInterface2, &IID_IMyInterface2, &LIBID_PRODUCTLib,
/*wMajor =*/ 1, /*wMinor =*/ 1>
(the interface names I used here are examples only of course)
If I change this back to 1.0, everything works fine, but I don't know
whether it's important that I revise my version now that I've added new
interfaces. Is there any down side to leaving everything as version 1.0???
date: Sun, 4 Jun 2006 21:41:18 -0400
author: Paul