xp下开发的ocx,xp注册成功,win7下注册不成功,
2016-02-26 17:22
393 查看
再次非常的感谢”赵4老师“的网上帮助、与指导
一、xp、Win 7 环境不同引起Ado编译错误 ,解决办法
(错误如下:
MSJRO.tlh(100) : error C2146: syntax error : missing ';'before identifier 'ConflictTables'
MSJRO.tlh(100) : error C2501: '_RecordsetPtr' : missingstorage-class or type specifiers
MSJRO.tlh(100) : error C2501: 'ConflictTables' : missingstorage-class or type specifiers
MSJRO.tlh(128) : error C2146: syntax error : missing ';'before identifier 'GetConflictTables'
MSJRO.tlh(128) : error C2501: '_RecordsetPtr' : missingstorage-class or type specifiers
MSJRO.tli(43) : error C2143: syntax error : missing ';' before'tag::id'
MSJRO.tli(43) : error C2433: '_RecordsetPtr' : 'inline' notpermitted on data declarations
MSJRO.tli(43) : error C2501: '_RecordsetPtr' : missingstorage-class or type specifiers
MSJRO.tli(43) : fatal error C1004: unexpected end of filefound
原来头文件相关代码是这样:
#if !defined(AFX_ADO2_H_INCLUDED_)
#define AFX_ADO2_H_INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <afx.h>
#include <afxdisp.h>
#include <math.h>
//#include "C:\Program Files\Microsoft Analysis Services\Samples\Include\msmd.h"
#pragma warning (disable: 4146)
// CG : In order to use this code against a different version of ADO, the appropriate
// ADO library needs to be used in the #import statement
//#import "C:\Program Files\Common Files\System\ADO\msado15.dll" rename("EOF", "EndOfFile")
//#import "C:\Program Files\Common Files\System\ado\MSJRO.DLL" no_namespace
#import "msado15.dll" rename("EOF", "EndOfFile")
#import "MSJRO.DLL" no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")
using namespace ADODB;
需要在路径中设置C:\ProgramFiles\Common Files\System\ado\
解决方案:
从XP 系统中拷贝msado15.dll,msjro.dll,放入数据库头文件同目录下,修改头文件:
#import "msado15.dll" rename("EOF", "EndOfFile")
#import "MSJRO.DLL" no_namespace rename("ReplicaTypeEnum","_ReplicaTypeEnum")
注意:红色字体部分为绝对路径,在新环境下控件还是会到对决路径下查找,由于xp、win7下的文件版本不同,而导致注册失败,提示找不到dll模块
由于前期的失误,以后绝对不能用绝对路径来引用控件,
二、在win7、2008 r2 中ocx注册不成功的解决(有的win7、2008系统没有问题)
1、各种注册方法都是过、即使把整个依赖文件都考到ocx同一文件夹下或系统文件夹下都无济于事。
2、把测试电脑都安装上开发环境,编译最后到注册控件环节就死掉了,把ocx解除占用后,编译成功,但还是在注册环节不能注册
3、用depends工具把所有问号的dll都放到系统下,注册问题依然不成功
4、最后看到了网上微软的ado bug的说明https://support.microsoft.com/zh-cn/kb/2640696,终于清楚了,
最终解决办法
1、从微软官网发布的的信息读到,应该server2003中的ado不存在此问题,此问题已经拖了好长时间了,为了节约时间所以先用2003,测试注册没有问题
2、有没有网友试过打一下win7或server2008的系统补丁包试试,以后再试试把,有测试过的网友反馈一下
相关文章推荐
- nginx + php-fpm fastcgi防止跨站、跨目录的安全设置
- Windows10中最强大--王爽汇编语言学习环境
- 使用jquery异步上传文件----SpringMVC注解开发
- hbase全表遍历的数据总是少很多
- IndentationError: unindent does not match any outer indentation level
- 从源码安装git
- excel 类获取起始列和使用列
- hrbust 哈理工oj 1834 括号匹配【好题】【floyd+dp】
- mycat 表名存在的坑
- YTU 2444: C++习题 对象转换
- UVA3268 二分+最大流,嘿嘿嘿
- Peeking into Linux kernel-land using /proc filesystem for quick’n’dirty troubleshooting
- html模块一些方法
- 【bug】使用pixi做虚拟摇杆时候发现的bug-不同的touch事件最后都可以出发touchend,即使没有touchstart先
- getline()之前存在cin时的使用
- 【Elasticsearch】深入Elasticsearch集群
- JavaScript之贪吃蛇
- 浅谈Android开发中内存泄露与优化
- 利用Spark Streaming来实现实时的数据管道服务
- iOS开发之微信聊天工具栏的封装