转自: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. VS2015 与 Git 的简单使用

    前言 在白忙之中抽了点时间,记录了下 VS 与 Git 的简单使用. 在之前使用命令行的时候,提交或拉取代码时,总报错:(提取时遇到错误: Unsupported URL protocol),后来在网 ...

  2. json 不能 dumps datetime 解决办法

    backend.myviews.json_time.py from datetime import date import json from datetime import datetime cla ...

  3. 把ui界面加入到工程中

    第一步   from untitled import Ui_Form untitled是ui转化成py的文件名:Ui_Form是转换后的类名 第二步  把Ui_Form做为工程的父类    class ...

  4. 2016年1月7日 隐藏NavigationBar时的一个坑

    http://www.jianshu.com/p/efb960fed457 - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear: ...

  5. 【tomcat】sessionId学习(未完待续)

    这里主要研究tomcat中session的管理方式以及sessionId的原理,下文将研究sessionid存到redis中以及基于redis实现session共享. 平时也就是了解session是基 ...

  6. ActiveMQ学习笔记1

    1.接口 JMS 公共 点对点域 发布/订阅域 ConnectionFactory QueueConnectionFactory TopicConnectionFactory Connection Q ...

  7. WPF工具开发: 第三库选择

    PropertyGrid Winforms's PropertyGrid 非WPF原生支持, 需要借助WinFormHost 风格不可定制 PropertyInspectorView 算是" ...

  8. 【转】Python之装饰器

    [转]Python之装饰器 本节内容 必要知识回顾 情景模拟 装饰器的概念及实现原理 回马枪(带参数的装饰器) 一. 必要知识回顾 在开始说装饰器之前,需要大家熟悉之前说过的相关知识点: 函数即“变量 ...

  9. 利用capability特征加强Linux系统安全【转】

    转自:https://blog.csdn.net/fivedragon/article/details/676849 1.简介 UNIX是一种安全操作系统,它给普通用户尽可能低的权限,而把全部的系统权 ...

  10. 如何用nodejs创建一个webservice

    Posted on March 25th, 2012 under Express.js, Node.jsTags: Express.js, git, GitHub, node.js Looking f ...