views:

712

answers:

1

I have created a Type Library out of a .NET DLL i created. I then imported it into Delphi and called a method within the interface of the COM Object. When it is trying to create the COomObject i get the Error that the class is not registered. The dll is registered with the GAC so it shouldn't be that. Anybody know what else could cause this?

+1  A: 

You need to expose the .NET assembly to COM - use regasm.exe with /codebase key.

sharptooth
Mine is exposed to COM by using the COM visible property and creatying a type library using the /tlb. From what i remember /codebase is when you want to specifys the assembly's path. But i have put it in the GAC so i shouldn't need to do that. Unless i am mistaken?
Andy Xufuris
ComVisible makes it possible to use the class through COM. But unless you've exposed it with regasm so that the class ids are added to the registry the consumer will be unable to detect the assembly location. You confuse three really different things. ComVisible make an entuty accessible from COM. The type library serves as a mechanism for consumers to discover what entities the assembly can expose. And exposing to registry with regasm lets a consumer to actually find the assembly that implements the class they want.
sharptooth