CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2009
    Posts
    144

    From 32bit to 64bit pc...

    I recently moved my project to my new pc and i have a problem when i run my project... i get the error

    Unable to find an entry point named 'InterlockedDecrement' in DLL 'kernel32.dll'

    what is going on ?

  2. #2
    Join Date
    May 2007
    Posts
    1,546

    Re: From 32bit to 64bit pc...

    This is either a question about a language other than C# or you're P/Invoking native code for a function which has a managed equivalent. If it's the latter, just use the built in Interlocked class.
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: From 32bit to 64bit pc...

    Just to be sure - your project is managed code, right?

    If so managed code is platform agnostic meaning it doesn't care what platform the code is run.

    The exception to this is if you are using any assemblies that use native code - like assemblies that make PInvoke calls. For this situation, you'll need to build the assembly for x86 or x64 and adjust the pinvoke calls as appropriate.

  4. #4
    Join Date
    Jun 2009
    Posts
    144

    Re: From 32bit to 64bit pc...

    thanks for your answers, but i finnaly solved this. i changed active solution platform form Any Cpu to x86 and all is good now

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: From 32bit to 64bit pc...

    The reason why this works is that your project is using some assemblies that contain 32-bit native code (or PInvoke to 32-bit native code). When you set the target platform to x86, you compile it for 32-bit and on a 64-bit machine, your code runs under the 32-bit emulator.

    I mention this because if you decide to run the project as a 64-bit app, you'll need to reference 64-bit assemblies (that contain native code).

    Hopefully that sheds some light on the issue.

  6. #6
    Join Date
    May 2007
    Posts
    1,546

    Re: From 32bit to 64bit pc...

    Back to my original point - Why are you P/Invoking native libraries to call a function which already has a managed equivalent? You're making your life so much more difficult for no gain!
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured