my program won't work on computer without framework, dow do i make a program that runs on every win

  • Thread starter Thread starter bart
  • Start date Start date
B

bart

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
 
bart said:
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
Yup.

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.

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.)
i would like to know how i can make windows programs that run on every
windows 2000/xp computer.

Don't use .NET, basically.
hope some of you can explain me the concept, i am probably doing ans seeing
things wrong here.

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?
 
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
 
bart said:
Is there a way i could use Visual Studio to make Windows programs that
don't require the framework dll's ?

Yes - but only by writing unmanaged C++.
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 ?

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 said:
Yes - but only by writing unmanaged C++.


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
 
bart said:
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?

Nothing - but Windows Forms are part of .NET, so you can't use them
without .NET.
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.

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.
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?

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.
 
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
 
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
 
bart said:
Let me think here, would it be possible that .NET is just made to protect
the monopolistic postion of Microsoft Windows?

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

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

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

Yes, use Delphi. :)
remembered that MFC was the microsoft way to distribute windows forms.

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/
"Programming is an art form that fights back"


ELKNews - Get your free copy at http://www.atozedsoftware.com
 
bart said:
I thought that the this framework is just a large library of classes

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.

http://code.acadx.com
(Pull the pin to reply)
 
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
i would like to know how i can make windows programs that run on
every windows 2000/xp computer.<
 
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

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.
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.

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.
 
Back
Top