5

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?

Sid Zhang
  • 972
  • 3
  • 9
  • 18
  • OCX belongs to the COM family and as such, interfaces and methods are not exported in the same way as regular .DLLs. You won't find them listed in the Exports table. Refer to Marius's answer as well as David Heffernan's suggestion to use `#import` –  Sep 24 '15 at 22:48

4 Answers4

3

Did you try the OLE/COM Object Viewer? http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5233b70d-d9b2-4cb5-aeb6-45664be858b6&displaylang=en

Marius Bancila
  • 16,053
  • 9
  • 49
  • 91
  • yes,I drag the ocx file into the OLE Obj Viewer,and I donot know the message's meaning. And I use another tool "Dll Export Viewer",and now I can see the function's name but can not get the parameter information. – Sid Zhang Mar 16 '11 at 08:20
  • @SidZhang You can't use DLL Export viewer tools with COM/OCX. You need to use COM techniques such as _type libraries_ –  Sep 24 '15 at 22:50
1

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.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
0

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)

harper
  • 13,345
  • 8
  • 56
  • 105
  • I use another tool "Dll Export Viewer",and now I can see the function's name but can not get the parameter. I need the parameter information now! – Sid Zhang Mar 16 '11 at 08:21
  • I tried "DLL Export Viewer" with one of my OCX. It showed me only the function names, no parameters. While inspecting the same OCX with OLE View I got the complete function signatures. It's worth to try OLE View. – harper Mar 16 '11 at 12:06
0

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.

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298