It’s an easy mistake to make. When I was doing the changes I described, I mistakenly thought that the GUIDs for the type library, the Tws class, the ITws interface and the ITwsEvents interfaces were the same. I couldn’t understand how this could be the case, but IB’s code definitely compiled and registered ok, so I just thought there must be something I wasn’t understanding right.
?
On my first attempt, I modified all the GUIDs by changing the first group of characters to something random, and blow me, it wouldn’t register. So I copied and pasted the original GUIDs into Notepad so I could compare them directly, like this:
?
Guid("0A77CCF5-052C-11D6-B0EC-00B0D074179C")
Guid("0A77CCF8-052C-11D6-B0EC-00B0D074179C")
Guid("0A77CCF6-052C-11D6-B0EC-00B0D074179C")
Guid("0A77CCF7-052C-11D6-B0EC-00B0D074179C")
?
and I still didn’t see the difference!
?
So then I looked in the registry at the interface entries, and there were the three entries all apparently with identical GUIDs: I knew that couldn’t possibly be right, as registry keys are unique. So I finally looked again very carefully character by character and noticed that they differed in the last character of the first group. Eureka!
?
After I modified my new GUIDs so they were all unique, everything worked fine.