现在的位置: 首页 > 综合 > 正文

终于解决了excel操作及cspreadsheet.h问题

2013年12月12日 ⁄ 综合 ⁄ 共 1124字 ⁄ 字号 评论关闭

困扰多日的excel操作问题终于解决:利用cspreadsheet.h!在vs2005下,不能直接应用cspreadsheet.h,所以必须解决些问题先。

首先,
出现暴多错误。
解决UNICODE问题,全部添加L。 [1]
+++++++++++++++++++
其次,
出现问题:
error   C2664:   'SQLGetInstalledDriversW '   :   cannot   convert   parameter   1   from   'char   [2001] '   to  
 'LPWSTR '
SQLGetInstalledDrivers(szBuf,cbBufMax,& cbBufOut)
SQLGetInstalledDriversW的参数1需要宽字符,
修正它!

char szBuf[2001];
char *pszBuf = szBuf;
改为
wchar_t szBuf[2001];
wchar_t *pszBuf = szBuf; [2]
+++++++++++++++++++++++

再次,
出现问题:
error C2665: 'strstr' : none of the 2 overloads could convert all the argument types
把strstr改写成_tcsstr 。 [3]
+++++++++++++++++++++++

同时会出现问题:
error C2665: 'strchr' : none of the 2 overloads could convert all the argument types
把strchr改写成wcschr。 [4]

------------------------------------

参考资料:

[1]cspreadsheet,编译不通过
http://topic.csdn.net/u/20080506/15/c7c1a0b6-7fb8-4e14-b1f0-102a853b7d6e.html?338699236
[2]char转换成LPWSTR的小问题??
http://topic.csdn.net/u/20070422/17/80f22eb8-c0f2-4313-b191-e86b60ef2f5b.html

[3]今天很高兴,又解决了一个问题,感谢牛牛们
http://blog.csdn.net/ehfaafzv/archive/2006/09/20/1253120.aspx

[4]Unicode and find exceldriver
http://www.codeguru.com/forum/showthread.php?threadid=433263

抱歉!评论已关闭.