VS2010向工具箱中添加控件解决 Microsoft Communications Control,未能实例化 设计时授权

第一步是Visual Studio 2010中添加注册控件的方法

在VC6.0中添加ADO Data Control等控件是很很方便的,"Project" --> "Add to Project" --> "Components and Controls" 中打开 "Components and Controls Gallery" 对话框,双击 "Registered ActiveX Controls" 目录就能找到这两个控件。也就是说VC 6.0下是默认注册了这两个控件的(一般情况应该装完VC 6.0就有了),直接拿来用就OK。但是在Visual Studio2010中不会自带这些控件,因此要先注册才能添加,下面以ADO Data Control控件为例,说明添加方法:

  1.先检查C:\WINDOWS\system32目录下有没有MSADODC.ocx这个文件(Visual Studio 2010不自带,因此,多半是没有的),没有就去下载;这是我下载的,如果有更高的版本也行http://download.csdn.net/source/3198530

  2.在VS 2010中注册MSADODC.ocx控件。在VS 2010中点击"Tools(工具)" --> "Visual Studio Command Prompt(Visual Studio命令提示)",在出现的窗口中输入如下命令回车即可:
            regsvr32 msadodc.ocx

  3.在“工具箱”里右击,单击“选择项”,在出现的对话框中选择“COM组件”选项卡,选中“Microsoft ADO Data Control,version 6.0(OLEDB)”,点击确定,在工具箱里就会出现这个控件了,需要用的时候就可以添加ADO Data Control控件了。(如果在工程中添加控件时出现“未能实例化activex 控件……因为这需要设计时授权”的问题,请参照上一篇日志)    

   在Visual Studio 2010中控件的添加方法大致都是如此,如ADO Data Grid,MSComm控件等。


VS2010向工具箱中添加串口控件,步骤为工具——选择工具箱项,在出现的选择工具箱项窗体中选择COM组件勾选Microsoft Communications Control, version 6.0,点击确定,你的工具箱中就会出现一个小电话标识的控件,这个控件就是串口控件,
如果是初次使用,可能会遇到一个问题“未能实例化ActiveX控件 因为这需要设计时授权”。

控件时出现“未能实例化控件******,因为这需要设计时授权”,请拿 出VS.NET 2003的安装盘,在 \VisualStudio2003Inst\Extras\VB6 Controls目录下应该能找到vb6controls.reg这个文件,双击它,把这个信息 添加到注册表中去,就可以了

没有设计期授权,所以无法在设计器中使用,你需要一个授权文件。 
把下面的文本保存为VB6Controls.reg文件,包含所有 VB 6.0 控件设计时的授权信息。你可以通过 RegEdit.exe 将 .reg 中的控件注册信息添加到你的注册表中,从而注册这些控件。

如果你在打开对话框时弹出 "The ActiveX control "Grid Control" could not be instantiated because it requires a design-time license"这个对话框时,在VC安装盘中找到vb6controls.reg,双击导入注册表就OK了,没有这个文件的可以COPY下面的代码另存 为*.reg,导入注册表就行了

REGEDIT
HKEY_CLASSES_ROOT\Licenses = Licensing: Copying the keys may be a violation of established copyrights.

// Masked Edit Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\BC96F860-9928-11cf-8AFA-00AA00C00905 = mmimfflflmqmlfffrlnmofhfkgrlmmfmqkqj

// Chart Control 6.0 (OLEDB) license key
HKEY_CLASSES_ROOT\Licenses\12B142A4-BD51-11d1-8C08-0000F8754DA1 = aadhgafabafajhchnbchehfambfbbachmfmb

// Common Dialog Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\4D553650-6ABE-11cf-8ADB-00AA00C00905 = gfjmrfkfifkmkfffrlmmgmhmnlulkmfmqkqj

// ADO Data Control 6.0 (OLEDB) license key
HKEY_CLASSES_ROOT\Licenses\C4145310-469C-11d1-B182-00A0C922E820 = konhqhioohihphkouimonhqhvnwiqhhhnjti

// Common Controls-3 6.0 license key
HKEY_CLASSES_ROOT\Licenses\38911DA0-E448-11D0-84A3-00DD01104159 = mcpckchcdchjcjcclidcgcgchdqdcjhcojpd

// Windows Common Controls-2 5.0 (SP2) license key
HKEY_CLASSES_ROOT\Licenses\9E799BF1-8817-11cf-958F-0020AFC28C3B = uqpqnqkjujkjjjjqwktjrjkjtkupsjnjtoun

// Windows Common Controls license key
HKEY_CLASSES_ROOT\Licenses\57CBF9E0-6AA7-11cf-8ADB-00AA00C00905 = aahakhchghkhfhaamghhbhbhkbpgfhahlfle

// Data Bound Grid Control 5.0(SP3) license key
HKEY_CLASSES_ROOT\Licenses\556C75F1-EFBC-11CF-B9F3-00A0247033C4 = xybiedobrqsprbijaegcbislrsiucfjdhisl

// Data Bound List Controls 6.0 license key
HKEY_CLASSES_ROOT\Licenses\096EFC40-6ABF-11cf-850C-08002B30345D = knsgigmnmngnmnigthmgpninrmumhgkgrlrk

// Internet Transfer Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\78E1BDD1-9941-11cf-9756-00AA00C00908 = yjrjvqkjlqqjnqkjvprqsjnjvkuknjpjtoun

// Multimedia Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\B1EFCCF0-6AC1-11cf-8ADB-00AA00C00905 = qqkjvqpqmqjjpqjjvpqqkqmqvkypoqjquoun

// Chart Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\7C35CA30-D112-11cf-8E72-00A0C90F26F8 = whmhmhohmhiorhkouimhihihwiwinhlosmsl

// Windows Common Controls-2 6.0 license key
HKEY_CLASSES_ROOT\Licenses\4F86BADF-9F77-11d1-B1B7-0000F8753F5D = iplpwpnippopupiivjrioppisjsjlpiiokuj

// Windows Common Controls 6.0 license key
HKEY_CLASSES_ROOT\Licenses\ED4B87C4-9F76-11d1-8BF7-0000F8754DA1 = knlggnmntgggrninthpgmnngrhqhnnjnslsh

// Comm Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905 = kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun

// DataGrid Control 6.0 (OLEDB) license key
HKEY_CLASSES_ROOT\Licenses\CDE57A55-8B86-11D0-b3C6-00A0C90AEA82 = ekpkhddkjkekpdjkqemkfkldoeoefkfdjfqe

// DataList Control 6.0 (OLEDB) license key
HKEY_CLASSES_ROOT\Licenses\A133F000-CCB0-11d0-A316-00AA00688B10 = cibbcimbpihbbbbbnhdbeidiocmcbbdbgdoc

// DBWin license key
HKEY_CLASSES_ROOT\Licenses\D015B071-D2ED-11d0-A31A-00AA00688B10 = gjdcfjpcmjicjcdcoihcechjlioiccechepd

// MSDBRPT license key
HKEY_CLASSES_ROOT\Licenses\9DF1A470-BA8E-11D0-849C-00A0C90DC8A9 = cchcqjejhcgcqcfjpdfcdjkckiqikchcojpd

// FlexGrid Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\72E67120-5959-11cf-91F6-C2863C385E30 = ibcbbbebqbdbciebmcobmbhifcmciibblgmf

// MAPI Controls 6.0 license key
HKEY_CLASSES_ROOT\Licenses\899B3E80-6AC6-11cf-8ADB-00AA00C00905 = wjsjjjlqmjpjrjjjvpqqkqmqukypoqjquoun

// MSRDO 2.0 license key
HKEY_CLASSES_ROOT\Licenses\B1692F60-23B0-11D0-8E95-00A0C90F26F8 = mjjjccncgjijrcfjpdfjfcejpdkdkcgjojpd

// RemoteData Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\43478d75-78e0-11cf-8e78-00a0d100038e = imshohohphlmnhimuinmphmmuiminhlmsmsl

// Windowless Controls 6.0 license key
HKEY_CLASSES_ROOT\Licenses\80E80EF0-DBBE-11D0-BCE2-00A0C90DCA10 = qijimitpmpnpxplpvjnikpkpqoxjmpkpoivj

// PictureClip Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\6FB38640-6AC7-11cf-8ADB-00AA00C00905 = gdjkokgdldikhdddpjkkekgknesjikdkoioh

// Rich TextBox Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\DC4D7920-6AC8-11cf-8ADB-00AA00C00905 = iokouhloohrojhhhtnooiokomiwnmohosmsl

// Sheridan Tab Control license key
HKEY_CLASSES_ROOT\Licenses\190B7910-992A-11cf-8AFA-00AA00C00905 = gclclcejjcmjdcccoikjlcecoioijjcjnhng

// SysInfo Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\E32E2733-1BC5-11d0-B8C3-00A0C90DCA10 = kmhfimlflmmfpffmsgfmhmimngtghmoflhsg

// Winsock Control 6.0 license key
HKEY_CLASSES_ROOT\Licenses\2c49f800-c2dd-11cf-9ad6-0080c7e7b78d = mlrljgrlhltlngjlthrligklpkrhllglqlrk





没有更多推荐了,返回首页