Thread: how to Ensure my program works across platforms??

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    114

    Wink how to Ensure my program works across platforms??

    how to Ensure my program works across platforms? namely, win98se and winxp?

    i know the easiest way to do is to simply test them across, but is there a better way?

    i work on my program at home using winxp and go down to my office (with win 98se) once a week to test my work

    since win98se is an older platform, the stuff i work on winxp might not always work on win98se

    some stuff i know:
    - when putting in new functions, check the function documentation to see if it works on the platform
    - if function doesnt work, try a work around using other functions

    does vc++6.0 SP6 have a "check across platform" function in it?
    OR if not, is that a program/plugin (preferbly free because i am not paid for my work) that checks whether my code works on win98se and hopefully report the snippets of codes that doesnt work or the extra stuff that needs to be installed before it works? because i dont wanna go down to my office to find that whatever worked at home doesnt work in the office.




    2nd qns : what does the following means? does it mean i gotta install extra stuff on win98se before the function works?


    Requirements
    Client: Requires Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
    Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server.
    Unicode: Implemented as Unicode and ANSI versions. Note that Unicode support on Windows Me/98/95 requires Microsoft Layer for Unicode.Header: Declared in Winnetwk.h.
    Library: Use Mpr.lib.

    using :
    - winxp at home, win98se at office
    - vc++6.0 SP6
    - MFC style

    thanks in advance! :wave:
    Last edited by hanhao; 06-21-2005 at 10:11 AM.

  2. #2
    Registered User mitakeet's Avatar
    Join Date
    Jun 2005
    Location
    Maryland, USA
    Posts
    212
    The compiler hides a lot from you, but Win9X and XP are two completely different OSs under the hood. There are ways to write things 'platform independant' (most people think of this is *nix, Mac and Windows compatiblity, so googling on those keywords ain't likely to get you want you want), but I don't know of any tutorials off-hand. You might want to google on Win9X and Win2K/XP/NT compatiblity to see if you can find some tutorials.

    Free code: http://sol-biotech.com/code/.

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw

  3. #3
    Registered User
    Join Date
    Jun 2004
    Posts
    722
    for diferent Windows versions refer to this article
    http://msdn.microsoft.com/library/de...ws_headers.asp
    There you'll find info on some macros.
    Use then to keep you code portable.

  4. #4
    x4000 Ruski's Avatar
    Join Date
    Jun 2002
    Location
    Outer Space!
    Posts
    542
    and what about windows-linux compability? i'm using dev-c++, it says that any application i write in windows will work in linux (if i don't use any extra windows functions (windows.h etc..)).. but once i try to load the program from linux he just says that it's a "windows application" and asks me what to run it with (im a linux noob..)
    what does signature stand for?

  5. #5
    Registered User mitakeet's Avatar
    Join Date
    Jun 2005
    Location
    Maryland, USA
    Posts
    212
    You must stick with ANSI or POSIX (poor POSIX support on Windows) in order to move programs between Windows and Linux and you MUST recompile!

    Free code: http://sol-biotech.com/code/.

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw

  6. #6
    Registered User
    Join Date
    Jun 2004
    Posts
    722
    Quote Originally Posted by Ruski
    and what about windows-linux compability? i'm using dev-c++, it says that any application i write in windows will work in linux (if i don't use any extra windows functions (windows.h etc..)).. but once i try to load the program from linux he just says that it's a "windows application" and asks me what to run it with (im a linux noob..)
    you have to recompile that source for the target machine... linux detects that that executable is for windows.

  7. #7
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Some good programming discipline will go a long way toward making life easier to write for both platforms.

    a) Write as much as possible in ANSI C++.
    b) Isolate the platform dependent code. This is where the object-oriented facilities come in very handy. You have one abstract interface, and you rely on some concrete, platform-dependent code a layer down to get done what you need.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  8. #8
    Registered User
    Join Date
    Mar 2004
    Posts
    114
    intead of doing tests on the exe file.......
    i believe that the best way is to have a program that scans the source code for functions that dont work with win98 OR win95 (as specified by the programmer) and report them

    is there a program that does this?

  9. #9
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    just write standard ANSI C++ code (like everybody else said) and it'll work. of course, you're going to have to recompile on each platform you want to run it on (as everybody already said as well)

    if you follow the standards and keep away from non-portable solutions, you'll be fine on other platforms.

    Dev-C++ uses GCC, which is the main compiler used on linux.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 01:42 AM
  2. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  3. My program works but the numbers are not correct.
    By romeoz in forum C++ Programming
    Replies: 4
    Last Post: 07-22-2003, 10:02 PM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM