get base com type name

  • Thread starter Thread starter Ingo Beyer
  • Start date Start date
I

Ingo Beyer

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
 
is there a way to get the name of this loaded library by using the parameter
typeLib?

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



Mattias
 
thats it! thank you!

Mattias Sjögren said:
Cast it to UCOMITypeLib and go from there (you can get the typelib
name with GetDocumentation(-1, out name, ...)).



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top