my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bart

    my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

    Hello,

    I'm so sorry, but i don't understand the concept of the .net environment
    yet.
    I made a simple program that retrieves the hostname and ipaddress of the
    local computer.

    But when i give thit .exe file to my friend he can't run it because he does
    not have the framwork 1.1
    I thought that the this framework is just a large library of classes wich
    you can you when coding, but now i see that yhe program only works on
    computers with this framework. it reminds me of Java programs wich only runs
    at computers where the java is at latest and configured level.

    i would like to know how i can make windows programs that run on every
    windows 2000/xp computer.

    hope some of you can explain me the concept, i am probably doing ans seeing
    things wrong here.

    grtx,
    b


  • Jon Skeet [C# MVP]

    #2
    Re: my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

    bart <bart@thatissec ret.nlm> wrote:[color=blue]
    > I'm so sorry, but i don't understand the concept of the .net environment
    > yet.
    > I made a simple program that retrieves the hostname and ipaddress of the
    > local computer.
    >
    > But when i give thit .exe file to my friend he can't run it because he does
    > not have the framwork 1.1[/color]

    Yup.
    [color=blue]
    > I thought that the this framework is just a large library of classes wich
    > you can you when coding, but now i see that yhe program only works on
    > computers with this framework. it reminds me of Java programs wich only runs
    > at computers where the java is at latest and configured level.[/color]

    Well, Java programs will work wherever a sufficient Java environment
    for that program is available - if you write a program which only uses
    Java 1.1 features, you can run that on a machine with only Java 1.1,
    even though Java is now at 1.4.2. It's the same for .NET, although
    stronger versioning makes it slightly harder to get something to work
    on both .NET 1.0 and 1.1 if you're developing with a 1.1-based IDE.
    (It's more likely to work properly when you do, however, for precisely
    the same reason.)
    [color=blue]
    > i would like to know how i can make windows programs that run on every
    > windows 2000/xp computer.[/color]

    Don't use .NET, basically.
    [color=blue]
    > hope some of you can explain me the concept, i am probably doing ans seeing
    > things wrong here.[/color]

    Nope - you're just seeing it as a big issue when I don't think it needs
    to be. If you wrote programs using DirectX9 features, would you expect
    those programs to be available on machines without DirectX9 on them?
    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    • bart

      #3
      Re: my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

      Hi Jon,

      Is there a way i could use Visual Studio to make Windows programs that don't
      require the framework dll's ?

      I was just testing to make a simple program. I used the DnsGetHostname( )
      class to get the hostname the computer. I could see that this class uses the
      system.dll in the framework directory.

      could i just not compile this code (system.dll) into the executable ?

      bart


      "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
      news:MPG.1a7c6a 175847fa3c989f7 d@msnews.micros oft.com...[color=blue]
      > bart <bart@thatissec ret.nlm> wrote:[color=green]
      > > I'm so sorry, but i don't understand the concept of the .net environment
      > > yet.
      > > I made a simple program that retrieves the hostname and ipaddress of the
      > > local computer.
      > >
      > > But when i give thit .exe file to my friend he can't run it because he[/color][/color]
      does[color=blue][color=green]
      > > not have the framwork 1.1[/color]
      >
      > Yup.
      >[color=green]
      > > I thought that the this framework is just a large library of classes[/color][/color]
      wich[color=blue][color=green]
      > > you can you when coding, but now i see that yhe program only works on
      > > computers with this framework. it reminds me of Java programs wich only[/color][/color]
      runs[color=blue][color=green]
      > > at computers where the java is at latest and configured level.[/color]
      >
      > Well, Java programs will work wherever a sufficient Java environment
      > for that program is available - if you write a program which only uses
      > Java 1.1 features, you can run that on a machine with only Java 1.1,
      > even though Java is now at 1.4.2. It's the same for .NET, although
      > stronger versioning makes it slightly harder to get something to work
      > on both .NET 1.0 and 1.1 if you're developing with a 1.1-based IDE.
      > (It's more likely to work properly when you do, however, for precisely
      > the same reason.)
      >[color=green]
      > > i would like to know how i can make windows programs that run on every
      > > windows 2000/xp computer.[/color]
      >
      > Don't use .NET, basically.
      >[color=green]
      > > hope some of you can explain me the concept, i am probably doing ans[/color][/color]
      seeing[color=blue][color=green]
      > > things wrong here.[/color]
      >
      > Nope - you're just seeing it as a big issue when I don't think it needs
      > to be. If you wrote programs using DirectX9 features, would you expect
      > those programs to be available on machines without DirectX9 on them?
      > --
      > Jon Skeet - <skeet@pobox.co m>
      > http://www.pobox.com/~skeet
      > If replying to the group, please do not mail me too[/color]


      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

        bart <bart@thatissec ret.nlm> wrote:[color=blue]
        > Is there a way i could use Visual Studio to make Windows programs that
        > don't require the framework dll's ?[/color]

        Yes - but only by writing unmanaged C++.
        [color=blue]
        > I was just testing to make a simple program. I used the DnsGetHostname( )
        > class to get the hostname the computer. I could see that this class uses the
        > system.dll in the framework directory.
        >
        > could i just not compile this code (system.dll) into the executable ?[/color]

        No, because it's not just a case of it using a library - .NET is a
        whole virtual execution environment, not just a set of libraries.

        --
        Jon Skeet - <skeet@pobox.co m>
        Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

        If replying to the group, please do not mail me too

        Comment

        • bart

          #5
          Re: my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

          "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
          news:MPG.1a7c7d 6444efac3b989f7 e@msnews.micros oft.com...[color=blue]
          > Yes - but only by writing unmanaged C++.[/color]


          Okay, when I choose a C++ project, i have following choices;

          ..NET
          ATL
          MFC
          Win32
          General

          But when i choose Win32, i don't see the Forms, what do i do wrong?

          what does unmanaged code mean? I read about it yesterday because i want to
          use/access the IP helper dll, with a P/Invoke method.

          Okay, here's what i want to code;

          I want to make a windows program that detect connection to a network /
          ipaddess change, and then based on the local IP adress i want to make
          changes to my windows HOSTS file. I want to have a systray status icon and
          be able to config from the systray icon.

          where do i start best?

          Bart



          Comment

          • Jon Skeet [C# MVP]

            #6
            Re: my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

            bart <bart@thatissec ret.nlm> wrote:[color=blue]
            > "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
            > news:MPG.1a7c7d 6444efac3b989f7 e@msnews.micros oft.com...[color=green]
            > > Yes - but only by writing unmanaged C++.[/color]
            >
            >
            > Okay, when I choose a C++ project, i have following choices;
            >
            > .NET
            > ATL
            > MFC
            > Win32
            > General
            >
            > But when i choose Win32, i don't see the Forms, what do i do wrong?[/color]

            Nothing - but Windows Forms are part of .NET, so you can't use them
            without .NET.
            [color=blue]
            > what does unmanaged code mean? I read about it yesterday because i want to
            > use/access the IP helper dll, with a P/Invoke method.[/color]

            Managed code is code which runs inside the virtual execution
            environment .NET provides - memory is "safe" (i.e. you can't go off the
            end of an array etc without getting an exception), you get garbage
            collection, declarative security etc.

            Unmanaged code is native code which executes directly within Windows,
            using Win32 library functions etc.
            [color=blue]
            > Okay, here's what i want to code;
            >
            > I want to make a windows program that detect connection to a network /
            > ipaddess change, and then based on the local IP adress i want to make
            > changes to my windows HOSTS file. I want to have a systray status icon and
            > be able to config from the systray icon.
            >
            > where do i start best?[/color]

            Well, if you want to write in C#, you *have* to use .NET. If you don't
            mind writing in C/C++ and using the Win32 routines rather than the .NET
            framework, choose MFC or Win32.

            --
            Jon Skeet - <skeet@pobox.co m>
            Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

            If replying to the group, please do not mail me too

            Comment

            • james

              #7
              Re: my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

              If you want to use Unmanaged C++, then you will have to do your own Windows
              Forms. Just like in
              VC++ 6.0 and earlier. The nice WinForms thing, is as others have said, only
              available to you in .NET.
              james

              "bart" <bart@thatissec ret.nlm> wrote in message
              news:4012bca6$0 $324$e4fe514c@n ews.xs4all.nl.. .[color=blue]
              > "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
              > news:MPG.1a7c7d 6444efac3b989f7 e@msnews.micros oft.com...[color=green]
              > > Yes - but only by writing unmanaged C++.[/color]
              >
              >
              > Okay, when I choose a C++ project, i have following choices;
              >
              > .NET
              > ATL
              > MFC
              > Win32
              > General
              >
              > But when i choose Win32, i don't see the Forms, what do i do wrong?
              >
              > what does unmanaged code mean? I read about it yesterday because i want to
              > use/access the IP helper dll, with a P/Invoke method.
              >
              > Okay, here's what i want to code;
              >
              > I want to make a windows program that detect connection to a network /
              > ipaddess change, and then based on the local IP adress i want to make
              > changes to my windows HOSTS file. I want to have a systray status icon and
              > be able to config from the systray icon.
              >
              > where do i start best?
              >
              > Bart
              >
              >
              >[/color]


              Comment

              • bart

                #8
                Re: my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

                virtual execution environment ?
                garbage collection?

                Let me think here, would it be possible that .NET is just made to protect
                the monopolistic postion of Microsoft Windows?

                I mean, there was already an environment with "virtual execution
                environment" and "garbage collection"
                yes, i am talking about JAVA

                Good to know this stuff, i didn't know that .NET code is run in a "virtual
                execution environment"

                What I don't understand is that Visual Studio does not have a Visual way to
                make normal (unmanaged) Windows code.
                Are you sure there is no way to use forms like Borland has? I thought i
                remembered that MFC was the microsoft way to distribute windows forms.

                B




                Comment

                • Chad Z. Hower aka Kudzu

                  #9
                  Re: my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

                  "bart" <bart@thatissec ret.nlm> wrote in news:40131629$0 $322
                  $e4fe514c@news. xs4all.nl:[color=blue]
                  > Let me think here, would it be possible that .NET is just made to protect
                  > the monopolistic postion of Microsoft Windows?[/color]

                  Both yes and no.
                  [color=blue]
                  > I mean, there was already an environment with "virtual execution
                  > environment" and "garbage collection"
                  > yes, i am talking about JAVA[/color]

                  They have many simlarities. But one major difference is Java is tied to a
                  language - .Net is not.
                  [color=blue]
                  > What I don't understand is that Visual Studio does not have a Visual way to
                  > make normal (unmanaged) Windows code.[/color]

                  The upper versions do, but only via C++ and MFC or straight WinAPI's. Yucky
                  stuff.
                  [color=blue]
                  > Are you sure there is no way to use forms like Borland has? I thought i[/color]

                  Yes, use Delphi. :)
                  [color=blue]
                  > remembered that MFC was the microsoft way to distribute windows forms.[/color]

                  It is - but MFC is anything but visual. It is nothing like Winforms or
                  Delphi.


                  --
                  Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
                  "Programmin g is an art form that fights back"


                  ELKNews - Get your free copy at http://www.atozedsoftware.com

                  Comment

                  • Frank Oquendo

                    #10
                    Re: my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

                    bart wrote:
                    [color=blue]
                    > I thought that the this framework is just a large library of classes[/color]

                    Even if that were the case, how would you propose to execute your
                    applications on PCs without that library of classes? From a redistributable
                    standpoint, .NET is no different than Visual Basic. Even dynamically-linked
                    MFC apps have to ensure that a compatible version of MFC is present on the
                    target system.

                    --
                    There are 10 kinds of people. Those who understand binary and those who
                    don't.


                    (Pull the pin to reply)


                    Comment

                    • Jeff Louie

                      #11
                      Re: my program won't work on computer without framework, dow do i make a program that runs on every windows 2k/xp system ?

                      Bart.. FWIW, any W2000 or XP user with broadband access can go to
                      www.microsoft.com click on windows update and select the 1.1 NET
                      framework for downloading.

                      I suspect the answer to your question would be to write in C++ using the
                      MFC framework and statically link to the MFC library.

                      Regards,
                      Jeff[color=blue]
                      >i would like to know how i can make windows programs that run on[/color]
                      every windows 2000/xp computer.<

                      *** Sent via Developersdex http://www.developersdex.com ***
                      Don't just participate in USENET...get rewarded for it!

                      Comment

                      • Bret Pehrson

                        #12
                        Re: my program won't work on computer without framework, dow do i make aprogram that runs on every windows 2k/xp system ?

                        > virtual execution environment ?[color=blue]
                        > garbage collection?
                        >
                        > Let me think here, would it be possible that .NET is just made to protect
                        > the monopolistic postion of Microsoft Windows?[/color]

                        ???
                        [color=blue]
                        > I mean, there was already an environment with "virtual execution
                        > environment" and "garbage collection"
                        > yes, i am talking about JAVA[/color]

                        You *might* want to catch up with current events. The reason that C# exists is
                        because of the legal issues between Sun and Microsoft regarding Java. MS
                        wanted to have its Java cake and eat it too, Sun wouldn't let them, so MS went
                        and made their own cake.
                        [color=blue]
                        > What I don't understand is that Visual Studio does not have a Visual way to
                        > make normal (unmanaged) Windows code.
                        > Are you sure there is no way to use forms like Borland has? I thought i
                        > remembered that MFC was the microsoft way to distribute windows forms.[/color]

                        There is a little bit of abuse regarding the term 'forms'. In .NET, it has a
                        completely new and different meaning than what you are probably accustomed to.
                        In .NET, forms refers to Windows Forms which is a new subsystem for user
                        interfaces.

                        You can still use the same mechanism to design user interfaces using the visual
                        designer for C++ (unmanaged) projects in VS.NET. It is just as 'visual' as the
                        previous version in VS 6.

                        --
                        Bret Pehrson
                        mailto:bret@inf owest.com
                        NOSPAM - Include this key in all e-mail correspondence <<38952rglkwdsl >>

                        Comment

                        Working...