为什么需要注册OCX控件?
转自: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控件?的更多相关文章
- Win7 64位系统 注册 ocx控件
32位系统注册ocx就不谈了.网上一搜一大把.下面说下win7 64位 旗舰版下如果注册ocx控件 1.首先复制 XXXX.OCX文件到“C:\Windows\SysWOW64”目录. (XXX ...
- windows下注册ocx控件
OCX 是对象类别扩充组件(Object Linking and Embedding (OLE) Control Extension):是可执行的文件的一种,但不可直接被执行: 是 ocx 控件的扩展 ...
- 在 浏览器中调用外接设备— —手写板 【win10 x64 手动注册ocx控件的方法】
PPAXSignToolSDK.ocx 浏览器下使用手写板时调用的控件,使用前必须先注册,,不然浏览器下版本无法正常工作. ocx 控件在安装包运行时会自动注册,如果安装包没有注册成功,需要进行手动注 ...
- 在Windows7/8/10 64位操作系统下安装并注册ocx控件
例如: 先网上下载一个MtbLine.ocx控件放入C:\Windows\SysWOW64\目录下 1.首先确保你的 Windows7 账户是管理员权限 2.下载MtbLine.ocx控件,网上可搜到 ...
- regsvr32 命令小集注册OCX控件,注册控件(包括十几个举例)
Regsvr32 进程文件: regsvr32 or regsvr32.exe 进程名称: Microsoft DLL Registration Service 英文描述: regsvr32.ex ...
- 如何注册OCX控件
32位系统: 将文件放到c:\windows\system目录 注册 运行:Regsvr32 c:\windows\system\xxx.ocx 取消注册运行:Regsvr32.exe /u c:\w ...
- FAQ:win7和win8 64位注册ocx控件方法
win7/win8 问题所在: 64位的系统一般都是可以安装32位程序的, 执行 C:\Windows\SysWOW64\regsvr32.exe 而不是 C:\Windows\Sys ...
- C#注册OCX控件
注意 COM组件注册到注册表中的位置,是CLSID还是TypeLib 注册方法 代码执行 //声明注册方法 [DllImport("C:\\Windows\\barcodex.ocx&quo ...
- VC++注册,卸载OCX控件,以及判断是否注册
注册OCX控件 BOOL CYourClass::RegistOcx() { HINSTANCE hLib = LoadLibrary("NTGraph.ocx"); / ...
随机推荐
- Hbase记录-HBase客户端API
本章介绍用于对HBase表上执行CRUD操作的HBase Java客户端API. HBase是用Java编写的,并具有Java原生API.因此,它提供了编程访问数据操纵语言(DML). HBaseCo ...
- linux的基本操作与常见命令
linux的基本操作与常见命令: jdk的安装: 步骤:(特别注意:虚拟机安装的一般是32位的操作系统,jdk也必须使用32位的) 查看虚拟机版本:sudo uname --m i686 //表示是3 ...
- Winform窗体设计工具源码
源代码:QQ群616945527,博客资源
- 后台拿webshell方法(2)
在这里总结一下后台拿webshell的方法: 备份突破(在博客上有随笔介绍) 一般在后台上传文件类型受到限制,可以利用数据库备份将其上传的格式改为后门执行格式即可: asp更改为jpg jpg ...
- luogu 1196 银河英雄传说 带权并查集
带权并查集,其实有点像许多队列问情况的小学奥数 #include<bits/stdc++.h> #define rep(i,x,y) for(register int i=x;i<= ...
- java 多线程断点下载功能
import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.io.Rand ...
- luogu P1776 宝物筛选_NOI导刊2010提高(02)
Sto flashhu orz flash太强啦 多重背包裸题(逃 使用压维大法,\(f_i\)为总重量为\(i\)时的答案 对于每种物品,记\(w\)为单个的重量,\(v\)为单个的价值,\(m\) ...
- vue学习之用 Vue.js + Vue Router 创建单页应用的几个步骤
通过vue学习一:新建或打开vue项目,创建好项目后,接下来的操作为: src目录重新规划——>新建几个页面——>配置这几个页面的路由——>给根实例注入路由配置 src目录重整 在项 ...
- 【docx4j】docx4j操作docx,实现替换内容、转换pdf、html等操作
主要是想要用此功插件操作docx,主要的操作就是操作段落等信息,另外,也想实现替换docx的内容,实现根据模板动态生成内容的效果,也想用此插件实现docx转换pdf. word的格式其实可以用xml来 ...
- 使用SSH远程登陆Linux
⒈SSH介绍 SSH(Secure Shell)由IETF的网络工作小组(NetWork Working Group)所制定,SSH是建立在应用层和传输层基础上的安全协议. SSH是目前较可靠,专为远 ...