Click here to Skip to main content
15,899,124 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Basically I would like to be able to create a program that points at any static library (fed as a file parameter) and generates a series of functions and structures that can be used in C#
Is this possible?
Posted

Like has been said already, that tool already exists for COM-based libraries.

It's impossible to write such a tool for standard libraries. The reason is that parameter and return value information is not stored in the library. Only the function names being exported can be found.
 
Share this answer
 
Why create one when it already exists, for free?

tlbimp.exe[^]
 
Share this answer
 
Comments
Dave Kreskowiak 5-Dec-13 16:20pm    
Warning to readers, that only works for COM-based libraries. It will NOT work for standard C libraries.
Ron Beyer 5-Dec-13 17:32pm    
I don't know if there is a way to automatically determine entry points in a C style library or to examine structs/types in that library. If you know of something like that I'd be interested to see.
Dave Kreskowiak 5-Dec-13 18:39pm    
What this guy is probably talking about is already covered by Dependency Walker[^]. It won't generate code, but it will list the exports and any parameter info that can be found (COM only.)

I don't know of anything that will dump structs or types.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900