0

Here's my class definition:

[ProgId("MyProject.MyClass")]
[ClassInterface(ClassInterfaceType.None)]
[Guid("...")]
[ComVisible(true)]
public class MyClass : IMyClass
{
  ...
}

What happens if a com client tries to create my object by the ProgId and there is randomly another one with the same ProgId?

conan.ak
  • 1
  • 2
  • 1
    Did you try it? What happens? – manuell Mar 29 '18 at 07:52
  • 3
    It is not going to be random. The installer of the component that ran last is going to overwrite the older one. Bad week for the user, typically. Otherwise a basic reason why the [Guid] is the superior way, they are Globally Unique ids. Don't use "MyProject", another programmer thought of that before. A trade-marked product name or company name is wise. – Hans Passant Mar 29 '18 at 08:01
  • thanks.. no worries.. I changed project and class name for this question :) – conan.ak Mar 30 '18 at 22:52

0 Answers0