Activex控件不能例示。 ActiveX 控件“Microsoft Chart
Control 6.0(sp4)(OLEDB)"不能例示, 因为它需要一个设计时间许可。
解决方法:
1.先到C:\WINDOWS\system32目录下看看你的系统里是否已经有了MSADODC.ocx和MSDATGRD.ocx这两个文件,没有就去下载;
如果COM组件中还是没有这两个控件,请单击“开始”->“所有程序”->“Microsoft
Visual Studio.NET 2003”->“Visual Studio .NET
工具”->“Visual Studio.NET 2003 命令提示”输入:regsvr32 msadodc.ocx和regsvr32 msdatgrd.ocx,即可以将这两个控件添加到工具箱中
2.VC环境中也有了相应的控件选项,
但一添加就提示“Activex控件不能例示”, 然后d出另一个提示:
ActiveX 控件“Microsoft Chart Control
6.0(sp4)(OLEDB)"不能例示, 因为它需要一个设计时间许可。
若添加控件出现这个问题就进行如下 *** 作:
把内容存为.reg文件。(Windows Registry Editor
Version 5.00.reg)双击导入注册表即可。。
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Licenses]
@="Licensing: Copying the keys may be a violation of established
copyrights."
[HKEY_CLASSES_ROOT\Licenses\096EFC40-6ABF-11cf-850C-08002B30345D]
@="knsgigmnmngnmnigthmgpninrmumhgkgrlrk"
[HKEY_CLASSES_ROOT\Licenses\12B142A4-BD51-11d1-8C08-0000F8754DA1]
@="aadhgafabafajhchnbchehfambfbbachmfmb"
[HKEY_CLASSES_ROOT\Licenses\190B7910-992A-11cf-8AFA-00AA00C00905]
@="gclclcejjcmjdcccoikjlcecoioijjcjnhng"
[HKEY_CLASSES_ROOT\Licenses\1F3D5522-3F42-11d1-B2FA-00A0C908FB55]
@="gcfjdjecpchcncdjpdejijgcrdoijjfcieod"
[HKEY_CLASSES_ROOT\Licenses\1FB639E1-771F-11d1-8FD4-00A0C91E29D5]
@="ldaskjeinankjgbnkcejnkrgnkvntkhzkhbtnkste"
[HKEY_CLASSES_ROOT\Licenses\2AC5863D-48B9-490c-ACD3-B7723A1FEB9E]
@="wrtgfdsbvxgfsdyuihjknmvcxgasdwqersdfdfsdyu"
[HKEY_CLASSES_ROOT\Licenses\2c49f800-c2dd-11cf-9ad6-0080c7e7b78d]
@="mlrljgrlhltlngjlthrligklpkrhllglqlrk"
[HKEY_CLASSES_ROOT\Licenses\38911DA0-E448-11D0-84A3-00DD01104159]
@="mcpckchcdchjcjcclidcgcgchdqdcjhcojpd"
[HKEY_CLASSES_ROOT\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905]
@="kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun"
[HKEY_CLASSES_ROOT\Licenses\43478d75-78e0-11cf-8e78-00a0d100038e]
@="imshohohphlmnhimuinmphmmuiminhlmsmsl"
[HKEY_CLASSES_ROOT\Licenses\46D504D7-557F-4C19-A4DD-6605411EF496]
"6A7693BA-3139-41fd-BF3D-299961C965D5"="01000000d08c9ddf0115d1118c7a00c04fc297eb01000000b0cfa8651eed814ea8aa77984d1819530400000018000000560053002000500049004400200049006e0066006f00000003660000a80000001000000056a66542c85db014774bffecdc56384e0000000004800000a000000010000000b10a1f771bc4b05515b611500ced2faf10000000263d1b0a183042c62cd7792b75683b4e14000000f30b3972d0fa2871120efa9fba18a3c245e584c2"
@="gknalnanccemnhitviluhawerycnonilwjawreacop"
"CCF5A555-D92E-457b-9235-2B326B64035A"="01000000d08c9ddf0115d1118c7a00c04fc297eb01000000b0cfa8651eed814ea8aa77984d1819530400000018000000560053002000500049004400200049006e0066006f00000003660000a8000000100000003311a4ed781bba0eb740244ec6be37e10000000004800000a0000000100000000ef4da56cd76cee7c81f1227b555434f080000000beff2eed562c9a114000000b389c01205cde0aa29234083954295bef840a8c3"
[HKEY_CLASSES_ROOT\Licenses\4D553650-6ABE-11cf-8ADB-00AA00C00905]
@="gfjmrfkfifkmkfffrlmmgmhmnlulkmfmqkqj"
[HKEY_CLASSES_ROOT\Licenses\4F86BADF-9F77-11d1-B1B7-0000F8753F5D]
@="iplpwpnippopupiivjrioppisjsjlpiiokuj"
[HKEY_CLASSES_ROOT\Licenses\556C75F1-EFBC-11CF-B9F3-00A0247033C4]
@="xybiedobrqsprbijaegcbislrsiucfjdhisl"
[HKEY_CLASSES_ROOT\Licenses\57CBF9E0-6AA7-11cf-8ADB-00AA00C00905]
@="aahakhchghkhfhaamghhbhbhkbpgfhahlfle"
[HKEY_CLASSES_ROOT\Licenses\5BCBC240-27DF-49C1-8C1C-27B8463009A9]
"6A7693BA-3139-41fd-BF3D-299961C965D5"="01000000d08c9ddf0115d1118c7a00c04fc297eb01000000b0cfa8651eed814ea8aa77984d18195304000000560000004d006900630072006f0073006f00660074002000560069007300750061006c002000530074007500640069006f00200054007200690061006c002000450064006900740069006f006e0020006400610074006100000003660000a800000010000000c7e1d2e887c57b9814ce91d6c44249ae0000000004800000a00000001000000035f65ddd0c11d820b0b7a72d384e4f08100000006e568533309b0e78012ede394f29e6d81400000080691310641b0c5f28070f7f29fe3acb3d3531a9"
@="iqtdwslvccydcyhxabrcudupqdcalezvinyxwsdjgb"
"CCF5A555-D92E-457b-9235-2B326B64035A"="01000000d08c9ddf0115d1118c7a00c04fc297eb01000000b0cfa8651eed814ea8aa77984d18195304000000560000004d006900630072006f0073006f00660074002000560069007300750061006c002000530074007500640069006f00200054007200690061006c002000450064006900740069006f006e0020006400610074006100000003660000a800000010000000157910d280b079e9030212f831ef8dd00000000004800000a00000001000000091b4ddfcf5198d358efe2a227e391200080000008943decdf61422b0140000006eafe0247bfe0b38ba34c5a3fc6106d9bae97edb"
[HKEY_CLASSES_ROOT\Licenses\6000720D-F342-11D1-AF65-00A0C90DCA10]
@="kefeflhlhlgenelerfleheietfmflelljeqf"
[HKEY_CLASSES_ROOT\Licenses\6FB38640-6AC7-11cf-8ADB-00AA00C00905]
@="gdjkokgdldikhdddpjkkekgknesjikdkoioh"
[HKEY_CLASSES_ROOT\Licenses\72E67120-5959-11cf-91F6-C2863C385E30]
@="ibcbbbebqbdbciebmcobmbhifcmciibblgmf"
[HKEY_CLASSES_ROOT\Licenses\73A4C9C1-D68D-11d0-98BF-00A0C90DC8D9]
[HKEY_CLASSES_ROOT\Licenses\73A4C9C1-D68D-11d0-98BF-00A0C90DC8D9\11.0]
[HKEY_CLASSES_ROOT\Licenses\73A4C9C1-D68D-11d0-98BF-00A0C90DC8D9\11.0\Retail]
@="sbbcdcprktpjtapmmfdacmupasbhscddncgp"
[HKEY_CLASSES_ROOT\Licenses\743A8267-4958-460e-B757-7110EED3D53C]
@="erwreffdrtetyuiopupoinjxsdfwdxvdgwertdxoui"
[HKEY_CLASSES_ROOT\Licenses\74872840-703A-11d1-A3AF-00A0C90F26FA]
@="mninuglgknogtgjnthmnggjgsmrmgniglish"
[HKEY_CLASSES_ROOT\Licenses\74872841-703A-11d1-A3AF-00A0C90F26FA]
@="klglsejeilmereglrfkleeheqkpkelgejgqf"
[HKEY_CLASSES_ROOT\Licenses\78E1BDD1-9941-11cf-9756-00AA00C00908]
@="yjrjvqkjlqqjnqkjvprqsjnjvkuknjpjtoun"
[HKEY_CLASSES_ROOT\Licenses\7C35CA30-D112-11cf-8E72-00A0C90F26F8]
@="whmhmhohmhiorhkouimhihihwiwinhlosmsl"
[HKEY_CLASSES_ROOT\Licenses\80E80EF0-DBBE-11D0-BCE2-00A0C90DCA10]
@="qijimitpmpnpxplpvjnikpkpqoxjmpkpoivj"
[HKEY_CLASSES_ROOT\Licenses\899B3E80-6AC6-11cf-8ADB-00AA00C00905]
@="wjsjjjlqmjpjrjjjvpqqkqmqukypoqjquoun"
[HKEY_CLASSES_ROOT\Licenses\9DF1A470-BA8E-11D0-849C-00A0C90DC8A9]
@="cchcqjejhcgcqcfjpdfcdjkckiqikchcojpd"
[HKEY_CLASSES_ROOT\Licenses\9E799BF1-8817-11cf-958F-0020AFC28C3B]
@="uqpqnqkjujkjjjjqwktjrjkjtkupsjnjtoun"
[HKEY_CLASSES_ROOT\Licenses\A133F000-CCB0-11d0-A316-00AA00688B10]
@="cibbcimbpihbbbbbnhdbeidiocmcbbdbgdoc"
[HKEY_CLASSES_ROOT\Licenses\a8a9f020-b426-11cf-bf3b-00a0d10003fa]
@="eesjgjnekjeeheijrfheiegepftigeljfepi"
[HKEY_CLASSES_ROOT\Licenses\AC0871D0-6ACC-11cf-8ADB-00AA00C00905]
@="knjnpgognginknggsmnnhnjnumvmlngnrlrk"
[HKEY_CLASSES_ROOT\Licenses\AEA64E56-7C97-4a1c-8974-4E0BB4E48FCD]
@="reuikcxsdrecfgfbvnhjkjlpouiyuqwsdrtrtbvgcv"
[HKEY_CLASSES_ROOT\Licenses\B1692F60-23B0-11D0-8E95-00A0C90F26F8]
@="mjjjccncgjijrcfjpdfjfcejpdkdkcgjojpd"
[HKEY_CLASSES_ROOT\Licenses\B1EFCCF0-6AC1-11cf-8ADB-00AA00C00905]
@="qqkjvqpqmqjjpqjjvpqqkqmqvkypoqjquoun"
[HKEY_CLASSES_ROOT\Licenses\BC96F860-9928-11cf-8AFA-00AA00C00905]
@="mmimfflflmqmlfffrlnmofhfkgrlmmfmqkqj"
[HKEY_CLASSES_ROOT\Licenses\C4145310-469C-11d1-B182-00A0C922E820]
@="konhqhioohihphkouimonhqhvnwiqhhhnjti"
[HKEY_CLASSES_ROOT\Licenses\CDE57A55-8B86-11D0-b3C6-00A0C90AEA82]
@="ekpkhddkjkekpdjkqemkfkldoeoefkfdjfqe"
[HKEY_CLASSES_ROOT\Licenses\CEDD4F80-B43C-11cf-837C-00AA00573EDE]
@=hex(2):67,00,78,00,77,00,61,00,65,00,7a,00,75,00,63,00,66,00,79,00,71,00,70,\
00,77,00,6a,00,67,00,71,00,62,00,63,00,6d,00,74,00,73,00,6e,00,63,00,75,00,\
68,00,77,00,73,00,6e,00,79,00,68,00,69,00,6f,00,68,00,77,00,78,00,7a,00,00,\
00
ActiveX控件用于Web的过程是将控件嵌入主页中,用户通过浏览器访问该主页时,将主页中的控件下载,并在用户机器上注册,以后就可在用户的浏览器上运行。控件下载一次后就驻留在用户本地机器上,下次再访问相同的主页时,可不再下载该控件,而是直接运行用户本地的控件。这里控件容器就是浏览器,用户不需要通过浏览器调用控件的属性或方法。
因此,开发面向Web的ActiveX控件比开发桌面的控件还要简单些,所复杂的是如何将该控件很好地嵌入主页,使用户能正常浏览。
在网上下载TeeChart控件并安装,安装自然不用多说,安装完后找到安装路径(带有TeeChart5.ocx文件),复制当前路径安装完后需要对控件进行简单的注册,打开cmd,通过cd指令并粘贴原来复制好的路径,转到软件安装好的目录;
接着输入:regsvr32 TeeChart5.ocx,然后d出对话框提示注册成功
注册完毕,打开VS2013,新建一个MFC项目,在VC++栏中找到MFC项目,选择好项目存放的目录并填写项目名称
接着是创建向导,只需修改选择“基于对话框”模式,至于“最小化框”和“最大化框”随各自情况选择,其余的默认点“下一步”即可
将默认生成的三个控件按delete键删除
接下来导入TeeChart控件,选择“工具"-》"选择工具箱项"-》"COM组件",找到"TeeChart Pro Active control v5"并选中它,点击"确定"
在工具箱中找到“TeeChart Pro Active control v5”控件并拖放到对话框上,适当调整控件大小
控件已经导入了,接下来需要添加相关的“类”和“变量”,首先添加类。
在“类视图”中右键项目名称,选择“添加”-》“类”;
然后选择“MFC”项中的“TypeLib中的MFC类”,点“添加”。
在注册表的可用类型库中找到"TeeChart Pro Active control v5<1.0>",这里不需要一直下拉慢慢找,只要输入"tee"就可以直接选中
在“接口”中选择所需的类,Teechart控件包含很多类,CTChart是必须的,对应的接口是“ITChart”,其他类包括CSeries、CAxis、CAxes、CTitles等等,这里仅以“CTChart”和“CSeries”为例,选择“ISeries”、“ITChart”。
确定以后可以在类视图中看到新添加的两个类。
接下来需要对控件关联变量,对控件右键选择“添加变量”,选择默认的控件类型,属于类“CTchart1”,对变量进行命名,这里命名为"m_chart",这样类和变量就关联好了。
12
项目中会多出一个tchart1.h文件和tchart1.cpp文件,在对话框类的头文件CTestDlg.h中会有“CTchart1 m_chart”的变量定义,但是CTestDlg.cpp文件中对话框类的构造函数会多出一句“, m_chart(0)”,需要把它删除,否则会编译出错。这样前期准备工作就完成了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)