无法找到DLL“kernel32.dll中”命名为“InterlockedIncrement”的切入点 - VS2005 @ Win7的64位切入点、命名为、dll、DLL

2023-09-08 01:11:39 作者:别奢望任何人为你感同身受

我与我的Visual Studio 2005的C#项目的一个问题。使用它在Windows XP下我一直,因为星期一。然后,我的笔记本电脑坏了,我的新一个我的Windows 7 64位和我仍在使用VS 2005

I have a problem with my Visual Studio 2005 C# project. I have been using it under Windows XP, since Monday. Then my laptop broke down and on my new one I have Windows 7 64 bit and I am still using VS 2005.

没有与源编译没有问题,但是当我运行程序它打破了上线下方

There is no problem with compilation of the source, but when I run the program it breaks on the line below

OdbcConnection cn;
cn = new OdbcConnection("dsn=My_dsn_name;");

我得到的错误:

I get the error:

EnrtyPointNotFoundExcepition被unhalted 的

无法找到名为InterlockedIncrement在DLLkernel32.dll中切入点

我想使用PostgresODBC 64位驱动程序的Postgres 8.4数据库连接。

I am trying to connect with a Postgres 8.4 database using PostgresODBC 64 bit driver.

任何解决方案或替代方法是值得欢迎的。我需要强调的是,解决方案,我建立需要在Windows XP 32位运行。

Any solution or workaround is welcome. I need to stress that the solution I am building needs to run under Windows XP 32bit.

有关问题的最新信息(从我的阶跃响应的评论,但不仅是):

Updated information about the issue (from my respones to the comments but not only):

当我尝试添加新的连接到我的VS项目,我得到的消息 ERROR [IM014] [微软] [ODBC驱动程序管理器]指定的DSN包含了驱动程序和应用程序之间的架构不匹配。我使用的是Windows 7 64位,Postgres的ODBC 64位驱动程序版本。 9.00.0200 的,Postgres的8.4 32位。 我从来没有使用过的的Dependency Walker 之前。不过,我已经打开的 KERNEL32.DLL 的距离的 \ SYSTEM32 和 \ Syswow64资料和 InterlockedIncrement 是present在从两个文件夹中的文件。 在我有一些的的TableAdapter ,然后我用它们来从Postgres的数据。它是当我使用WinXP的设置,并且它仍然有效。在另一方面,当在VS2005中的属性的TableAdapter 我点击 ... 旁边的数据 - > CommandText中它显示消息无法调用ODBC驱动程序连接实用程序。 When I tried to add new connection to my VS project I got the message ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application. I use Windows 7 64 bit, Postgres ODBC 64 bit Driver ver. 9.00.0200, Postgres 8.4 32 bit. I have never used Dependency Walker before. But I have opened kernel32.dll from both \system32 and \SysWOW64 and InterlockedIncrement is present in files from both folders. I have some TableAdapters, and I use them to fetch data from the Postgres. It was set when I was using WinXP, and it still works. On the other hand, when in VS2005 in the properties of TableAdapter I click on "..." next to Data->CommandText it displays a message Failed to call the ODBC driver connection utility.

编辑:我加1-3点上方

I added points 1-3 above.

推荐答案

我想我已经解决了问题,但我不知道。不过,我安装的Postgres ODBC驱动程序和我用ODBC管理员ç32位版本的32位版本:\ WINDOWS \ Syswow64资料\ odbcad32.exe的以配置连接。我发现了大约32位ODBC管理器中的线程 64位ODBC的异常在哪里其中一个用户是指 MSDN:管理数据源

I think I have solved problem, although I am not sure. However, I installed the 32bit version of Postgres ODBC driver and I used 32bit version of ODBC administrator C:\Windows\SysWOW64\odbcad32.exe to configure the connection. I found the information about the 32bit ODBC Administrator in the thread 64-bit-odbc-exception where one of the users refers to MSDN: Managing Data Sources.

我以为我需要的ODBC驱动程序的相同版本(regarting到位数)为我的操作系统。我也尝试过的Postgres和ODBC驱动程序的64位版本,但它也不想为我工作。唯一的解决方案是32位版本的Postgres,和ODBC,和连接设置在 32位ODBC管理

I thought that I needed the same version of ODBC driver (regarting to number of bits) as my OS. I have also tried 64bit version of Postgres and ODBC driver, but it also did not want to work for me. The only solution was 32bit version of Postgres, and ODBC, and connection set in 32bit ODBC Administrator.

关于我的VS项目,我的项目 - >属性 - >建设 - >目标平台的设置为 86 。

Regarding my VS project, I have Project->Properties->Build->Platform target set to x86.

希望它可以帮助别人的未来。

Hope it helps somebody in the future.