Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: Really no way to free an object ? Pin
scadaguy5-Feb-04 13:56
scadaguy5-Feb-04 13:56 
GeneralCan't call a method with parameters when opening a thread Pin
Peter Mills5-Feb-04 7:27
Peter Mills5-Feb-04 7:27 
GeneralRe: Can't call a method with parameters when opening a thread Pin
Bill Dean5-Feb-04 8:39
Bill Dean5-Feb-04 8:39 
GeneralRe: Can't call a method with parameters when opening a thread Pin
boogs5-Feb-04 8:42
boogs5-Feb-04 8:42 
GeneralRe: Can't call a method with parameters when opening a thread Pin
Heath Stewart5-Feb-04 18:04
protectorHeath Stewart5-Feb-04 18:04 
GeneralRe: Can't call a method with parameters when opening a thread Pin
Peter Mills7-Feb-04 14:26
Peter Mills7-Feb-04 14:26 
Generalremoving registry garbages Pin
Shahin775-Feb-04 6:23
Shahin775-Feb-04 6:23 
GeneralRe: removing registry garbages Pin
Heath Stewart5-Feb-04 6:38
protectorHeath Stewart5-Feb-04 6:38 
The reason you see multiple typelib references is because they are using different GUIDs, so even if such a function existed (which it doesn't, but it isn't hard to create) it would be effective because each typelib is registering with a different GUID (otherwise you wouldn't see multiple references).

Remove them manually by searching for your typelib using regedit.exe.

The thing to do is eliminate the problem. You MUST use hard-coded GUIDs using the GuidAttribute for all classes and interfaces that are exposed as COM objects and interfaces. The GUID on the interface should NEVER change. If you need a new interface, implement the previous version of the interface and create a new one (like IMyInterface2), giving it a new GUID. The class GUID should typically not change.

To solve your immediately problem, you should also use an assembly-level GuidAttribute for your assembly, which is used as the typelib ID when a typelib is generated:
[assembly: Guid("cac7a0f0-c3a7-4039-abd7-1bc55b924bd7")]
(Generate your own, though)

When you register your class using regasm.exe /tlb <filename> now, the typelib will always have the same GUID and only the last path you registered will exist in the registry.

You should read those links I gave a while back discussing exposing .NET controls as COM objects. It does discuss this as well.

 

Microsoft MVP, Visual C#
My Articles
GeneralJava vs. C# means file watcher problems Pin
RB@Emphasys5-Feb-04 6:22
RB@Emphasys5-Feb-04 6:22 
GeneralRe: Java vs. C# means file watcher problems Pin
Heath Stewart5-Feb-04 6:47
protectorHeath Stewart5-Feb-04 6:47 
GeneralRe: Java vs. C# means file watcher problems Pin
RB@Emphasys5-Feb-04 7:08
RB@Emphasys5-Feb-04 7:08 
GeneralWeb Service error Pin
Peter Greenall5-Feb-04 5:55
Peter Greenall5-Feb-04 5:55 
GeneralImpersonation and FileSystemWatcher (threading?) Pin
Bill Dean5-Feb-04 5:47
Bill Dean5-Feb-04 5:47 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
John Fisher5-Feb-04 6:00
John Fisher5-Feb-04 6:00 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Bill Dean5-Feb-04 6:08
Bill Dean5-Feb-04 6:08 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Heath Stewart5-Feb-04 6:29
protectorHeath Stewart5-Feb-04 6:29 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Bill Dean5-Feb-04 6:54
Bill Dean5-Feb-04 6:54 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Heath Stewart5-Feb-04 8:51
protectorHeath Stewart5-Feb-04 8:51 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Bill Dean5-Feb-04 9:26
Bill Dean5-Feb-04 9:26 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Bill Dean5-Feb-04 16:00
Bill Dean5-Feb-04 16:00 
GeneralComboBox in Grid Pin
H r M5-Feb-04 5:03
H r M5-Feb-04 5:03 
GeneralRe: ComboBox in Grid Pin
John Fisher5-Feb-04 5:29
John Fisher5-Feb-04 5:29 
GeneralObtaining VBA stored BLOB Values from a Database Pin
Paul Kennedy5-Feb-04 5:01
Paul Kennedy5-Feb-04 5:01 
GeneralRe: Obtaining VBA stored BLOB Values from a Database Pin
John Fisher5-Feb-04 5:40
John Fisher5-Feb-04 5:40 
GeneralRe: Obtaining VBA stored BLOB Values from a Database Pin
Heath Stewart5-Feb-04 6:14
protectorHeath Stewart5-Feb-04 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.