Sagotharan
Sagotharan

Reputation: 2626

How can i see the Dll Classes Without object browser in visual studio?

I have one Non Valid Assembly, So i can't import in visual studio reference. Then i find out the solution, like [DllImport("ScanDll.dll")] in C#. I have done that.

Now I want to see the dll classes,.

How can i see the Dll Classes Without object browser in visual studio?

Upvotes: 1

Views: 2574

Answers (2)

Roger Rowland
Roger Rowland

Reputation: 26259

Further to my comment on your question,

If you use DllImport it must be a native dll, not managed. The only way to see what's in it is to look at the header file that belongs with it

if you do have the source code for the native DLL, you might like to try using the PInvoke Interop Assistant to generate the C# necessary to interact with the DLL. Be aware that this is imperfect though so YMMV.

You can only "browse" the DLL classes if you have the source code. There is no way to do this if you only have the DLL.

By using the Dependency Walker, as suggested by @Anders Abel, you can get some information about the exported classes and functions. However the main problem with using this to generate a C# wrapper is that there is no information you can see to distinguish an argument passed as a pointer or by reference, even then a pointer may imply an array. In C# you would need to know this so you can apply the correct ref or out qualifiers, for example.

Upvotes: 1

Anders Abel
Anders Abel

Reputation: 69260

If it is an unmanaged DLL the normal way to get information about the methods available is through a header file supplied with the DLL.

If you don't have any header file, you use the Dependency Walker (depends.exe) to see what functions are exported by the DLL.

Upvotes: 1

Related Questions