Groups | Blog | Home
all groups > c# > july 2005 >

c# : get base com type name


Ingo Beyer
7/21/2005 11:07:45 PM
hi,

in a c# app i dynamically loaded a com type library:
AssemblyBuilder ab = tlc.ConvertTypeLibToAssembly(typeLib, "temp.dll", 0,
ceh, null, null, null, null);

while loading .net raises an event becauce it found a external reference.

this is my event handler: (it's in a class derived from
ITypeLibImporterNotifySink)

public Assembly ResolveRef( object typeLib )
{
TypeLibConverter tlc = new TypeLibConverter();
ConversionEventHandler ceh = new ConversionEventHandler();
AssemblyBuilder ab = tlc.ConvertTypeLibToAssembly(typeLib, "temp.dll", 0,
ceh, null, null, null, null);
return ab;
}

the external reference is also a native com library.

is there a way to get the name of this loaded library by using the parameter
typeLib?

For example:
I wrote a com lib in vb6 which uses Scripting.FileSystemObject as return
datatype of a method. then i dynamically load my vb6-com-lib and the app
raises the event. in this moment typeLib points to
"Scripting.FileSystemObject". I somehow need to get the name (here:
"Scripting") of the loaded lib...

thank you!

ingo

Mattias Sjögren
7/21/2005 11:41:45 PM

[quoted text, click to view]

Cast it to UCOMITypeLib and go from there (you can get the typelib
name with GetDocumentation(-1, out name, ...)).



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Ingo Beyer
7/22/2005 10:10:48 AM
thats it! thank you!

"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> schrieb im Newsbeitrag
news:eVDj7yjjFHA.1412@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button