转自:http://searchwindevelopment.techtarget.com/answer/Why-do-I-need-to-register-OCX-controls

 OCX's have to be registered due to the registry.  I realize that's a bit of a circular reference. OCX's are binary code that conforms to the Component Object Model (COM) programming model. The key tenant of COM is that they are only partially self-describing.

  When your program requests a COM object, it asks the Object Linking and Embedding (OLE) subsystem of the operating system for the object. OLE's job is to read the HKEY_CLASSES_ROOT key from the registry for the requested object. A Globally Unique Identifier (GUID), a 128-bit number, identifies the object itself. When an OCX registers itself, it declares it's GUID and where the OLE system can find that particular .OCX file. In essence, you can think of the registry as the translation layer.

  Since I can read minds, some of you are wondering what the difference is with .NET. Where a COM object is not self-describing, a .NET object is completely self-describing. Where a COM object has data in it's binary as well as the registry to describe it, a .NET object has every bit of information about itself inside the binary. (By the way, this information in .NET is called the meta-data.)

  With meta-data, anyone can load up a .NET object and using a technique called Reflection; you can find out exactly what methods and properties that object supports and call those methods and properties with the proper parameters. This works even if there are all sorts of custom data types and whatnot in the .NET object. With COM, the only way you can call unique methods on an object is to manually program them. The only way you can call methods and properties on a COM object is to have a priori knowledge those methods and properties and manually writing to code to call them.

为什么需要注册OCX控件?的更多相关文章

  1. Win7 64位系统 注册 ocx控件

    32位系统注册ocx就不谈了.网上一搜一大把.下面说下win7 64位 旗舰版下如果注册ocx控件    1.首先复制 XXXX.OCX文件到“C:\Windows\SysWOW64”目录. (XXX ...

  2. windows下注册ocx控件

    OCX 是对象类别扩充组件(Object Linking and Embedding (OLE) Control Extension):是可执行的文件的一种,但不可直接被执行: 是 ocx 控件的扩展 ...

  3. 在 浏览器中调用外接设备— —手写板 【win10 x64 手动注册ocx控件的方法】

    PPAXSignToolSDK.ocx 浏览器下使用手写板时调用的控件,使用前必须先注册,,不然浏览器下版本无法正常工作. ocx 控件在安装包运行时会自动注册,如果安装包没有注册成功,需要进行手动注 ...

  4. 在Windows7/8/10 64位操作系统下安装并注册ocx控件

    例如: 先网上下载一个MtbLine.ocx控件放入C:\Windows\SysWOW64\目录下 1.首先确保你的 Windows7 账户是管理员权限 2.下载MtbLine.ocx控件,网上可搜到 ...

  5. regsvr32 命令小集注册OCX控件,注册控件(包括十几个举例)

    Regsvr32 进程文件: regsvr32 or regsvr32.exe  进程名称: Microsoft DLL Registration Service  英文描述: regsvr32.ex ...

  6. 如何注册OCX控件

    32位系统: 将文件放到c:\windows\system目录 注册 运行:Regsvr32 c:\windows\system\xxx.ocx 取消注册运行:Regsvr32.exe /u c:\w ...

  7. FAQ:win7和win8 64位注册ocx控件方法

    win7/win8 问题所在: 64位的系统一般都是可以安装32位程序的, 执行         C:\Windows\SysWOW64\regsvr32.exe 而不是 C:\Windows\Sys ...

  8. C#注册OCX控件

    注意 COM组件注册到注册表中的位置,是CLSID还是TypeLib 注册方法 代码执行 //声明注册方法 [DllImport("C:\\Windows\\barcodex.ocx&quo ...

  9. VC++注册,卸载OCX控件,以及判断是否注册

    注册OCX控件 BOOL CYourClass::RegistOcx() { HINSTANCE hLib = LoadLibrary("NTGraph.ocx");      / ...

随机推荐

  1. JAVA-大白话探索JVM-类加载过程(二)

    首先我们知道JVM是什么以及类加载器的作用 不清楚的可以看看JAVA-大白话探索JVM-类加载器(一) 现在我们来摸索下类的加载过程 首先,我们将类加载过程分为三步走 装载 链接 初始化 其中 链接 ...

  2. java.lang.UnsupportedClassVersionError: xxx/xxxClass : Unsupported major.minor version 51.0【转】

    以下小段参考自overflow: Unsupported major.minor version 52.0 [duplicate] 或csdn也有提及 : http://blog.csdn.net/p ...

  3. 把svn上的mycelipse导到本地的eclipse中【原】

    myeclipse和eclipse的web项目互导时会产生各种问题,现在把我遇到的情况记录如下: eclipse如何把svn上down下来的myeclipseWeb项目变成eclipse的Web项目: ...

  4. Linux - 服务基础

    /etc/init.d/sendmail start # 启动服务 /etc/init.d/sendmail stop # 关闭服务 /etc/init.d/sendmail status # 查看服 ...

  5. Spring源码解读

    beanfactory https://www.cnblogs.com/lspz/p/6244948.html requestmapping https://blog.csdn.net/u012557 ...

  6. Node、PHP、Java 和 Go 服务端 I/O 性能PK

    http://blog.csdn.net/listen2you/article/details/72935679

  7. Fragment的常用写法

    一般通过add.show.hide相结合的方法来控制Fragment的显示和隐藏,这样不会再重写一遍Fragment的生命周期,节省了时间和内存,当然特殊需求除外. package com.examp ...

  8. 启动apache 提示Starting httpd: AH00558

    Starting httpd: AH00558: httpd: Could not reliably determine the server's fully qualified domain nam ...

  9. android 基础题

    1. Android的四大组件是哪些,它们的作用? (1).Activity:Activity是Android程序与用户交互的窗口,是Android构造块中最基本的一种,它需要为保持各界面的状态,做很 ...

  10. Linux的记事本 Vi和Vim

    ⒈Vi和Vim的三种模式 ①正常模式 在正常模式下可以使用快捷键 默认进入的是正常模式 ②编辑模式(插入模式) 在该模式下可以输入内容 按下I,i,O,o,A,a,R,r等任何一个字母之后才可以进入该 ...