This is my first thrust with COM.. I am not sure I am really clear with the concept though I think I have picked up the basics. I am working on an enhancement with COM. Have gone through quite a few tutorials but I found some stuffs still confusing/unexplained.

I am trying to do the following and this is how and why I am doing. Please comment if it makes sense :

I need to add two new methods [accessors] for an already exising COM implementing class [it implements 3 interfaces currently]. I have done it as below :

i) I have added a new interface[with UUID] in the IDL file. The reason I added a new interface instead of adding to the exisitng one is I suspect, adding new methods would screw up the programs which are already using the interface. Am I correct ?

ii) I see that all interfaces are added inside some co-class in the IDL. I added this new interface to one of the co-class where other related interfaces were defined. But honestly, what does this co-class do ? Is it some kind of a 'abstract class' definition or access point? Should I need to change the UUID now after adding a new interface ?

iii) I added the interface the COM implementing class and put up a COM_INTERFACE_ENTRY(newInterface).

Are the above steps correct or am I missing something ? I see that all other interfaces have a "smart pointer definition" [ex : _COM_SMARTPTR_TYPEDEF(IAtlas2, __uuidof(IAtlas2)); ] but not able to see one for my interface. Why is it so ?

Update : In the COM/OLE viewer, i can see the new interface being defined for the co-class. the problem is "new" .tlh and .tli files are not getting generated even on a complete rebuild.

2 solutions

Solution 1

finally, after 4 hours, I fou8nd out what the problem is.. The solution was not running the file which contained #import.. hence, the new interface definition was not available since the new .tlh and .tli files never got created.. Hopefully, this will help some newbie like me.. !!

Btw, if someone could clear the doubts I have, it would be really helpful :

i) I had to add two new functions. if I had added to the existing interfaces which are released, would it have screwed up the interfaces ? Was there a need to add a new interface or was there another way around ?

ii) what exactly does a co-class does ? is it some kind of a abstract class definition [IDL way!!] which gets implemented by a programming language which inherits it ?