Is .NET framework installed with COM wrappers

G

Guest

Hi
In the framework directory I found a lot of tlb files. Does that mean that
the framework can be used by COM by default?

I want to do the following from COM/vba with .NET wrappers. Is that possible?:

Public Shared Function Load(ByVal FilePath As String, ByVal MyType As
String, ByVal MyMethod As String, ByVal MyArguments() As Object) As Object
Dim loadAssembly As System.Reflection.Assembly
Dim loadType As Type
Dim executeMethod As System.Reflection.MethodInfo
Dim loadObject As Object

loadAssembly = System.Reflection.Assembly.LoadFile(FilePath)
loadType = loadAssembly.GetType(MyType)
executeMethod = loadType.GetMethod(MyMethod)
loadObject = Activator.CreateInstance(loadType)
Return executeMethod.Invoke(loadObject, MyArguments)

End Function

Is their any utility which I can use to discover which dll a specified
function belongs to? In this case I want to know where Reflection is?

The ultimate goal is to call a .NET dll from whithin Excel 2000 whithout any
client installations. The only demand is that the framework is instaled and
you know where the .NET dll is.

Regards
/Niklas
 
N

Nicholas Paldino [.NET/C# MVP]

Niklas,

For what you want to do, you would need to create a wrapper for
mscorlib.dll, for which there is no corresponding .tlb that is installed
with the framework. You would have to install and register it yourself.

Hope this helps.
 
N

Nicholas Paldino [.NET/C# MVP]

Niklas,

My mistake, there is a wrapper for it. It looks like you should be able
to just set a reference and use it.

As for discovering which dll as specified function belongs to, the
methods are attached to objects, which have types. Those types are always
housed in modules in assemblies. The heiarchy tree is pretty simple, you
can walk up it from any Type instance.
 

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

Top