Thread: Code works in Win2K but not XP

  1. #1
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163

    Code works in Win2K but not XP

    I recently completed a project that required some advanced programming that I paid a third party programmer to do -
    My problem is that the code worked in Win2K but not under Windows XP I cannot contact the programmer but I do have the source code.

    Can anyone suggest why c++ wouldn't work in XP? Any suggestions on settings that I need to change?

    I have 2 computers running XP and the code works on neither of them.
    My site to register for all my other websites!
    'Clifton Bazaar'

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Does it compile? If not, then the error messages point out what to look for. If it does, but crashes during run-time, then you need to run in debug mode to see where you are when it all goes to heck.

  3. #3
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    Compiles and runs in XP. The program puts a .DLL into another program and a message box pops up to say that it is correctly injected - but no data is shown even though Win2K it works perfectly
    My site to register for all my other websites!
    'Clifton Bazaar'

  4. #4
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    With limited info you provided it is hard to say. I personally don't see code injection as a good solution.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Could be a depreciated function (works in WIN2K but was removed/modified for XP).
    One way top check is to highlight each WIN32 call in the app and press F1 (in MSVC) to bring up the help (select the relevant help page).
    Check the 'Requirements' at the bottom of the page (which lists the OSs the function works on).

    If this is a large app I would add logging/messageboxes to show the progress of the app, moving them until they do not show up because the app has failed (ie narrow down the amount of code the error is in so you ave less to search).


    Could also be a difference in 32/64bit OSs but I think you might have mentioned that.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #6
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    I have worked out that the program works but the program it is hooking out of is having it's memory protected by windows XP, any ideas how to disable this protection?
    My site to register for all my other websites!
    'Clifton Bazaar'

  7. #7
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    I wanted to edit my previous post but it wouldn't let me

    I have put two other versions of windows XP on this computer but neither of them work; I then put windows 7 on the computer and it didn't work either. Could their be something in the bios that is stopping the memory being read?
    Sorry if it's a newbie question but I'm not a programmer.
    My site to register for all my other websites!
    'Clifton Bazaar'

  8. #8
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    What program are you hooking?

    Why do you have to use hooking (and not some other form of IPC)?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program works on Windows XP and 2000, not on 98 or ME
    By MidnightlyCoder in forum C++ Programming
    Replies: 7
    Last Post: 03-10-2006, 03:36 PM
  2. Code works in MS Visual C++, not in Dev-C++
    By Kheila in forum C++ Programming
    Replies: 12
    Last Post: 11-13-2005, 01:15 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Problem : Threads WILL NOT DIE!!
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2004, 01:37 PM
  5. Seems like correct code, but results are not right...
    By OmniMirror in forum C Programming
    Replies: 4
    Last Post: 02-13-2003, 01:33 PM

Tags for this Thread