views:

61

answers:

1

Hello,

I need to call unmanaged COM code from C#.NET. By Loading unmanaged COM Type libraries from (LoadTypeLibEx), I am able to iterate over all exposed types by COM TLB. Now I need to call those exposed methods at run time by knowing their addresses or by accessing some how COM vtable's starting address and by applying indexing for getting addresses of those exposed methods under interfaces.

How this can be acheived..?

Regards Usman

A: 

Just a suggestion:

Create a proxy unmanaged COM server which will do that for you, by using only fixed set of methods, than use this proxy service from your c# application

volody
It would be quite tough to write proxy unmanaged COM servers. I dont need to go for code generation for every COM EXE/DLL which is unmanaged binary as DLL/EXE. All I need to ENUMERATE all types with their exposed methods at run time and at run time I need to call exposed methods by accessing their addresses from vtable. No code generation
Usman
just one com server, but with ability to enumerate all types and methods for requested dll. follow Enumerate COM object (IDispatch) methods using ATL?http://stackoverflow.com/questions/2112302/enumerate-com-object-idispatch-methods-using-atl
volody
my idea that you can do that with unmanaged code what is possible, then provide this informaion to c# client through COM interface
volody
Actually I've found InterOpServices namespace under System.Runtime .This enables you to enumerate exaclty all types contained in unmanaged binary. So Why go for Unmanaged code to write this. I want maximum .NET power to exploit. Just one thing remains.. Only to call these functions at runtime using addresses , which I am searching for...
Usman