Sid Zhang
Sid Zhang

Reputation: 972

How can I see the interfaces of a ocx file?

I want to see the interfaces of an ".ocx" file. Like this:

enter image description here

But for some .ocx, I can only see 5 functions, Like this:

enter image description here

The question is: How can I see the interfaces of these ocx file. I have try this:

A.
a) I want register it and see it in visual studio. But when I register it, an error appears "LoadLibrary(path:\filename.ocx) failed". Like this:

enter image description here

b) Then I used 'Dependency Walker' open the ocx, found the file dependences no DLL files . enter image description here

c) How can I register it?

B. I use "Dll Export Viewer" and now I can see the function's name but still can not get the function's parameters. How can i get the parameters of a function?

Upvotes: 5

Views: 15601

Answers (4)

harper
harper

Reputation: 13690

The interface is described in the type library (TLB). Your DLL (OCX is a DLL) should contain the TLB in a TypeLibrary resource. You can extract this TLB and get the interface description. This job should also be done by OLE View.

If your DLL does not contain a TLB and no TLB file is provided you won't get the interface description.

Edit: Tools like "DLL Export Viewer" showed less information than OLE View. It's worth to use the tools provided by Microsoft.

When you have the decorated names in your files screenshot, you get the function signatures with the "Microsoft (R) C++ Name Undecorator" (undname.exe)

Upvotes: 0

Simon Mourier
Simon Mourier

Reputation: 139075

Long time ago, I used this tool called XRay: X-Ray Vision. It was quite simple to use and still works in Windows 7 I believe. But as other tools, it requires the DLL/OCX to embed a Type Library, or you need to find the corresponding one.

Upvotes: 0

David Heffernan
David Heffernan

Reputation: 613302

Import the type library with the Type Library Importer.

Since you are using C++, it's probably easiest to do this with #import.

This Code Project article gives step-by-step procedures.

Upvotes: 1

Related Questions