Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 关于32/64位操作系统下,应用程序兼容性问题

关于32/64位操作系统下,应用程序兼容性问题

Scheduled Pinned Locked Moved C / C++ / MFC
10 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xjh_sz
    wrote on last edited by
    #1

    最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。

    L S D S X 6 Replies Last reply
    0
    • X xjh_sz

      最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Sorry, but we cannot understand this, can you please have your question translated into English?

      It's time for a new signature.

      1 Reply Last reply
      0
      • X xjh_sz

        最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。

        S Offline
        S Offline
        Sauro Viti
        wrote on last edited by
        #3

        This is an english only website, please translate your question: we are not able to understand it

        L 1 Reply Last reply
        0
        • X xjh_sz

          最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          xjh_sz wrote:

          For example UpdateDriverforPlugAndDevice (), I used GetLastError (), see the error.

          And what is that error?

          xjh_sz wrote:

          The problem is solved, but I now maintain two versions with the next 32, 64 a; do not know what a good way, just run a version.

          Not sure I understand this. Are you wanting one set of source code, but two separate exe files?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          Y 1 Reply Last reply
          0
          • X xjh_sz

            最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。

            S Offline
            S Offline
            sunlin7
            wrote on last edited by
            #5

            You would get more help if you describe your problems in English. 以前你也用中文在这里叫过吧?鬼佬们不懂中文,白瞎了~~ 个人理解,仅供参考: win32程序在win64上面是通过wow64工作的,被。64位程隔离在一个独立的环境里面序和32位程序在用户层不可互访。因此没有办法只用一个程序在64位和32位间无缝转换。即64环境中必须用64的程序才能安装64位的驱动,32位环境中只能用32位程序安装驱动。 不过完全可以做到在源代码层面统一。

            modified on Wednesday, July 21, 2010 9:19 AM

            1 Reply Last reply
            0
            • D David Crow

              xjh_sz wrote:

              For example UpdateDriverforPlugAndDevice (), I used GetLastError (), see the error.

              And what is that error?

              xjh_sz wrote:

              The problem is solved, but I now maintain two versions with the next 32, 64 a; do not know what a good way, just run a version.

              Not sure I understand this. Are you wanting one set of source code, but two separate exe files?

              "One man's wage rise is another man's price increase." - Harold Wilson

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              "Man who follows car will be exhausted." - Confucius

              Y Offline
              Y Offline
              Yusuf
              wrote on last edited by
              #6

              Dave, It is nice of you to translate OP question and try to give some clue. Shouldn't you tranlated your answer to chinease though ;P ;)

              Yusuf May I help you?

              D 1 Reply Last reply
              0
              • Y Yusuf

                Dave, It is nice of you to translate OP question and try to give some clue. Shouldn't you tranlated your answer to chinease though ;P ;)

                Yusuf May I help you?

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                Yusuf wrote:

                Shouldn't you tranlated your answer to chinease though

                不,我不会说中文。

                "One man's wage rise is another man's price increase." - Harold Wilson

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                "Man who follows car will be exhausted." - Confucius

                1 Reply Last reply
                0
                • X xjh_sz

                  最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  xjh_sz wrote:

                  I recently created a driver installation program, which uses a number of core functions such as UpdateDriverforPlugAndDevices(), using vs2008, in 32-bit operating system everything is working properly. But win32 program can run in x64, but under x64 it does not work. For example UpdateDriverForPlugandPlayDevices() raises an error, I used GetLastError (), and I see an error code. Later I was using a 64-bit system with vs2008 and compiled the x64 program, everything works fine, but the program can not run in win32. The problem is now solved, but I now maintain two versions of the installer 32 and 64; I do not know what a better way, I just run a seperate version of the executable.

                  Hi xjh_sz, I believe that you are doing the correct thing by creating two separate installers for 32 and 64 bit. UpdateDriverForPlugAndPlayDevices does not support WOW64. You might be able to get your 32 bit installer to work by calling Wow64EnableWow64FsRedirection[^] but I honestly don't know for sure. Some additional documentation: Driver Installation for 32-bit and 64-bit Platforms[^] Best Wishes, -David Delaune

                  1 Reply Last reply
                  0
                  • S Sauro Viti

                    This is an english only website, please translate your question: we are not able to understand it

                    L Offline
                    L Offline
                    Luc Pattyn
                    wrote on last edited by
                    #9

                    No it isn't. We even have non-English forums, such as this http://www.codeproject.com/Forums/1580230/General-Programming-Chinese.aspx[^] :)

                    Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                    Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                    1 Reply Last reply
                    0
                    • X xjh_sz

                      最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。

                      X Offline
                      X Offline
                      xjh_sz
                      wrote on last edited by
                      #10

                      First,thanks for your replies.I am sorry to you because I asked question in chinese. My question is as fllows. I recently created a driver installation program, which uses a number of core functions such as UpdateDriverforPlugAndDevice(), using vs2008, in 32-bit operating system everything is working properly. But win32 program can run in x64, but under x64 it does not work. For example UpdateDriverForPlugandPlayDevices() raises an error, I used GetLastError (), and I see an error code. Later I was using a 64-bit system with vs2008 and compiled the x64 program, everything works fine, but the program can not run in win32. The problem is now solved, but I now maintain two versions of the installer 32 and 64; I do not know what a better way, I just run a seperate version of the executable.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups