Could not find entry point named "InterlockedIncrement" in DLL "kernel32.dll" - VS2005 @ Win7 64 bit

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

There is no problem compiling the source, but when I run the program, it splits into the line below

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

I get an error message:

EnrtyPointNotFoundExcepition has been blocked

Unable to find entry point named "InterlockedIncrement" in DLL "kernel32.dll"

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

Any solution or workaround is welcome. I need to emphasize that the solution I am creating should run under Windows XP 32bit.

Updated information about the problem (from my comments on comments, but not only):

  • When I tried to add a new connection to my VS project, I received the error ERROR [IM014] [Microsoft] [ODBC Driver Manager] The indicated DSN contains an architecture mismatch between the Driver and the Application . I am using 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 opened the kernel32.dll file from both systems: system32 and \ SysWOW64 and InterlockedIncrement is present in the files from both folders.
  • TableAdapters, Postgres. , WinXP, . , VS2005 TableAdapter "..." Data- > CommandText, ODBC.

EDIT: 1-3 .

+3
4

, , . , 32- ODBC Postgres . 32- ODBC C:\Windows\SysWOW64\odbcad32.exe. 32- ODBC 64-bit-odbc-exception, MSDN: .

, ODBC ( ), . 64- Postgres ODBC, . 32- Postgres, ODBC 32- ODBC-.

VS, Project- > Properties- > Build- > Platform target x86.

, - .

0

, : System.Data.Odbc Microsoft.Data.Odbc .

+5

64- , kernel32.dll - . , P/ , .

They are currently embedded in 32-bit windows, but exported functions are still available from kernel32.dll in 32-bit windows for application compatibility reasons. Not a problem for 64 bits, because there were no applications compatible with.

+4
source

I think something is wrong with your driver. I cannot be sure, but you might consider using something else. Npgsql looks pretty decent, and it is 100% C # code, so it should work on 32-bit Windows XP without any problems.

+1
source

All Articles