Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ C++;VS2008中的项目有效,但VS2010中的项目无效_C++_Visual Studio 2010_Odbc - Fatal编程技术网

C++ C++;VS2008中的项目有效,但VS2010中的项目无效

C++ C++;VS2008中的项目有效,但VS2010中的项目无效,c++,visual-studio-2010,odbc,C++,Visual Studio 2010,Odbc,我在VS2008中构建了PostgreSQL ODBC驱动程序,然后运行odbcad32.exe,创建DSN并单击测试按钮。它很好用。 然后,我复制了文件夹并在VS2010中重建了它,然后执行了相同的操作:我收到错误消息无法发送查询(连接已断开) 然后我做了:在VS2005中编译-所有作品。 在Vs2012中-不起作用。 我签入了调试器:是的,它是,在短查询执行期间套接字被关闭,按钮测试生成如下查询序列: set DateStyle to 'ISO' .... set extra_float_d

我在VS2008中构建了PostgreSQL ODBC驱动程序,然后运行odbcad32.exe,创建DSN并单击测试按钮。它很好用。 然后,我复制了文件夹并在VS2010中重建了它,然后执行了相同的操作:我收到错误消息无法发送查询(连接已断开)

然后我做了:在VS2005中编译-所有作品。 在Vs2012中-不起作用。 我签入了调试器:是的,它是,在短查询执行期间套接字被关闭,按钮测试生成如下查询序列:

set DateStyle to 'ISO'
....
set extra_float_digits to 2
...
[5912-1.471]CC_send_query: conn=04460048, query='select oid, typbasetype from pg_type where typname = 'lo''
[5912-1.472]send_query: done sending query 63bytes flushed
[5912-1.473]in QR_Constructor
[5912-1.473]exit QR_Constructor
[5912-1.473]read -1, global_socket_buffersize=4096
[5912-1.474]Lasterror=10035
[5912-1.474](5)Error while reading from the socket. ERRNO=10035
[5912-1.475]CC_error_statements: self=04460048
[5912-1.475]CONN ERROR: func=CC_send_query, desc='', errnum=107, errmsg='No response from the backend'
...
[5912-1.481]CC_lookup_characterset: entering...
[5912-1.481]CC_send_query: conn=04460048, query='select pg_client_encoding()'
[5912-1.482]CC_error_statements: self=04460048
[5912-1.482]CONN ERROR: func=CC_send_query, desc='', errnum=104, errmsg='Could not send Query(connection dead)'
这种不同行为的原因可能是什么

问题是,自VS2010以来,eWooldBlock(在errno.h中定义)!=WSAEWOULDBLOCK,而开发人员依赖于这两个值是相同的,类似于:

r = recv( ... );
if (r == -1 && WSAGetLastError() == EWOULDBLOCK) { ... }
以前在旧版本的VS中使用的方法不再有效