.OCX

OCX File

ActiveX Control
Ask a question
QUICK ANSWER

An OCX file is an ActiveX Control, a Windows library (technically a COM-based DLL) that provides a reusable component to other programs, common in old Visual Basic 6 and Office VBA applications. You cannot open it by double-clicking. If a program reports a missing or unregistered OCX, reinstall the program that owns it rather than downloading the file from a third-party site. If you must register it manually, use "regsvr32 file.ocx" from an elevated Command Prompt.

Developer: Microsoft Category: Developer Files MIME: application/octet-stream
OPENS ON Windows
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Jul 21, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the OCX file format?

.ocx files are associated with the ActiveX control module for the Microsoft Windows operating system. The format originated in 1994 as OLE Custom Controls and was rebranded as ActiveX Controls in 1996. Structurally, an .ocx file is a compiled Windows PE binary - effectively a .dll that starts with the MZ magic header and exposes COM control interfaces, including the mandatory DllRegisterServer export.

ActiveX is a software framework for managing components used by applications developed in programming languages such as:

  • Visual Basic,
  • C++,
  • Delphi,
  • PowerBuilder.

Controls stored in .ocx files allow for fast and efficient data exchange between various applications running on Windows. They facilitate information transmission between elements and allow for rapid application development. Each control is registered in the Windows Registry by running regsvr32 file.ocx; to unregister, use regsvr32 /u file.ocx. Controls can also be used to run components in various environments - for example, as in-page web browser applets - though this use is now considered legacy since ActiveX support was dropped in Microsoft Edge and retired with Internet Explorer in 2022-2023. An embedded .tlb type library inside the .rsrc section describes the control's interfaces to host tools.

It is advised to disable ActiveX due to the known security risks it exposes the system to. Disabling ActiveX prevents .ocx files from being loaded by browsers or legacy host applications. For new Windows development, WinForms and WPF controls have effectively replaced the ActiveX model.

Security & safety

RISK: HIGH

An OCX is executable code that registers itself deep in Windows (COM/CLSID), so it deserves caution. Risks: malicious or trojanised ActiveX controls can run with the host app's privileges, and ActiveX was historically a major browser-drive-by vector in Internet Explorer (now retired). "OCX download" sites are a classic malware/PUP channel and usually supply a wrong-version control that won't fix the app anyway. Rules: fix missing-OCX errors by reinstalling the program that owns the control, not by downloading the OCX from a third-party site; if you must obtain a known Microsoft control (e.g. MSCOMCTL.OCX), get it from the official Microsoft package; check an unknown OCX's digital signature (Properties > Digital Signatures) and scan it on VirusTotal before registering it. Never register OCX files you don't trust.

Format details

in a nutshell
FULL NAMEActiveX Controlaka OLE Control Extension, ActiveX Control file
DEVELOPERMicrosoftsince 1994 (OLE Custom Controls / OCX); rebranded ActiveX Controls in 1996
MIME TYPEapplication/octet-stream
TYPEWindows PE (Portable Executable) DLL exposing COM/ActiveX controls - compiled binary
MAGIC BYTES · FILE SIGNATURE
OFFSET
0001
HEX
4D5A
ASCII
MZ
An OCX is a PE file: it starts with "MZ", and "PE\0\0" (50 45 00 00) appears at the offset stored in the DOS header field e_lfanew (0x3C). The DLL flag (bit 0x2000 in the COFF Characteristics field) is set - an OCX is structurally a DLL that exports DllRegisterServer and exposes COM control interfaces.

Programs that open OCX files

Windows5 apps
Microsoft Visual Studio Freemium For developers: inspect or host the control; use the legacy ActiveX Control Test Container / OLE-COM Object Viewer to view its interfaces.
Resource Hacker Free Open the OCX to view/extract icons, dialogs, version info and other resources (it's a PE file).
Microsoft Windows (regsvr32, built-in) Built-in Register the control: open an elevated Command Prompt and run 'regsvr32 path\to\file.ocx' (use the 32-bit C:\Windows\SysWOW64\regsvr32 for 32-bit OCX on 64-bit Windows).
Visual Basic 6 IDE (legacy) Paid Add the OCX via Project > Components to drop the control onto a form - the original ActiveX host. Legacy/EOL.
Dependencies (lucasg) Open-source Open the OCX to see its imports/exports and which DLLs it requires - useful when registration fails with missing dependencies.

Technical details

deep spec
File structurePE (Portable Executable) binary - same container as a .dll; DOS stub + MZ header, PE/COFF headers, section table, code/data sections, and a .rsrc resource section
Magic bytes0x4D 0x5A ("MZ") at offset 0; PE signature 0x50 0x45 0x00 0x00 at the offset stored in the DOS e_lfanew field (0x3C)
PE variantPE32 (x86/32-bit) or PE32+ (AMD64/x64); DLL characteristic flag (0x2000) set in the COFF Characteristics field
Required exportsDllRegisterServer, DllUnregisterServer, DllGetClassObject, DllCanUnloadNow - mandatory for a self-registering COM server
Registration mechanismregsvr32 file.ocx writes CLSID, ProgID, and type-library GUIDs under HKCR\CLSID\{...} in the Windows Registry; regsvr32 /u removes them
COM interfaces (UI control)Must implement IUnknown; in-process UI controls additionally expose IOleObject, IOleControl, IOleInPlaceObject, and IDispatch for scripting and VBA automation
Embedded type libraryA compiled .tlb type-library resource is typically embedded in the .rsrc PE section, describing the control's interfaces to IDEs and VBA hosts
Byte orderLittle-endian (Intel/x86 native)
EncodingBinary (compiled native code - not interpreted or text-based)
Typical file size20 KB - 10 MB depending on the number of controls and embedded UI resources
Authenticode supportOptional Authenticode digital signature for publisher verification; PE header CheckSum field provides a basic integrity check
MIME typeapplication/octet-stream (no MIME type specific to .ocx is registered)
Host dependencyCannot run standalone; must be instantiated by a COM-aware host: VB6 IDE, MFC/ATL application, Office VBA user form, or legacy Internet Explorer
Security statusConsidered high-risk (arbitrary native-code execution in host process); dropped in Microsoft Edge; retired with Internet Explorer in 2022-2023
Predecessor formatReplaced 16-bit .vbx (Visual Basic Extension) controls introduced with Visual Basic 1.0 in 1991
Platform supportWindows (Win32 / Win64) only; no native support on macOS or Linux
Released1994 (OLE Custom Controls / OCX); rebranded ActiveX Controls in 1996
Latest versionN/A (tied to the COM/ActiveX model; effectively frozen, legacy on modern Windows)
Specificationlearn.microsoft.com

OCX conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with OCX files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about OCX files.

Frequently asked questions

How do I register an OCX file with regsvr32?
Open an elevated Command Prompt and run 'regsvr32 path\to\file.ocx'. On 64-bit Windows a 32-bit control must be registered with the 32-bit tool: 'C:\Windows\SysWOW64\regsvr32 file.ocx'. Unregister with the '/u' switch.
How do I fix 'Component XXXX.ocx not correctly registered' or 'missing OCX'?
Best: reinstall the program that owns the control. If you have the OCX, copy it to the app's folder (or System32/SysWOW64) and register it with regsvr32. For Microsoft controls like MSCOMCTL.OCX, install the official Microsoft package rather than a random download.
What is an OCX file and how is it different from a DLL?
An OCX is an ActiveX Control - structurally a DLL (PE library) but specialised to expose COM controls (UI widgets, components) that host apps embed. The .ocx name signals it's a registerable ActiveX control rather than a general library.
Can I open or run an OCX by double-clicking it?
No - an OCX has no standalone entry point. It's loaded by a host program (VB6, an Office VBA form, a legacy app) via its COM CLSID after being registered with regsvr32.
Is it safe to download an OCX from an 'OCX download' website?
No. Those sites are an unverified malware/PUP vector, and a mismatched version usually won't fix your app. Reinstall the owning program or get Microsoft controls from official Microsoft packages instead.
Are OCX files still used? Do they work in Edge/modern Windows?
They're legacy. ActiveX never worked in Microsoft Edge and went away with Internet Explorer's retirement (2022-2023). OCX controls still run inside old desktop apps (VB6/VBA) on current Windows, but new software uses .NET controls instead.

References

1Microsoft Learn - ActiveX Controls (MFC)learn.microsoft.com
2Microsoft Learn - PE Format specificationlearn.microsoft.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.BINCD/DVD Disc Image (BIN/CUE)
3.PARTPartial Download File
4.MDMarkdown Document
5.RPMSGRestricted Permission Message
6.CRDOWNLOADChrome Partial Download File
7.NOMEDIAAndroid No-Media Marker File
8.PRDXSoftMaker Presentations Document
9.PRO6XProPresenter 6 Bundle File
10.SWFSmall Web Format (Shockwave Flash)

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z