468,170 Members | 2,008 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,170 developers. It's quick & easy.

Win32 or .NET and compilers

drhowarddrfine
7,435 Expert 4TB
I have to write/get some code to poll a linux server and securely download a web page (or text file) and print it on a remote XP computer's printer. I have not done any Windows programming in years but, after doing a little research, I think I found enough on MSDN to put this together. However, it's the Win32 API, which I am most familiar with, using WinHTTP.

So I'm thinking that, even though I've never used it before, I would like to future proof this little executable by using .NET, but I don't want to have to go through a long process of learning the .NET framework ins/outs when I'm sure I can get the Win32 version done relatively quick. Pointers on how to do that?

Since I think I know I can do it in Win32, is there a way to convert it to work with .NET, or is there no advantage or method to that?

I have Visual Studio, 2004, I think, but never used it and I don't think it works with .NET(?) and I'd rather not install it just for this, so I can download VS Express(?) or just get the command line compiler from the SDK.

(I just groaned because I remember I have to install all that. I wonder if I should just go back to my assembly roots and do it there cause I don't need the whole SDK. But I digress.)

EDIT: I just clicked over to another page and read something. To communicate with a web server, would my customer have to be using XP Professional or will Home do? I think he has Pro but not sure.
Oct 11 '08 #1
8 1094
Curtis Rutland
3,256 Expert 2GB
Well, you can use the Win32 API inside a .NET program using DllImport, but many of the methods that they offer are implemented natively in managed code. Are you planning on using Visual C++, C#, or VB.NET? There is no Visual Studio 2004. 2k3, 2k5, and 2k8. The express editions should do what you want.

One thing to look into would be the object HttpWebRequest. This is part of the .NET framework, and can send web requests and receive web responses. I must confess I've never tried to implement this securely, so I dont know if that will work for you, but it's worth looking into.

I don't see how the version of XP would limit making requests to web servers? You need Pro to install IIS, the windows web server, but I don't think it will matter for what you want to do.
Oct 11 '08 #2
drhowarddrfine
7,435 Expert 4TB
Well, you can use the Win32 API inside a .NET program
I wouldn't know what makes a .NET program other than using the framework. Is the only difference that you are making .NET objects instead of Win32 API calls?
Are you planning on using Visual C++, C#, or VB.NET?
The last time I did anything on Win I coded in assembly language with the SDK and compiled with masm. I do recall compiling something when .NET came out but, again, used teh compiler that came with the SDK. If anything, I used straight C with the C++ compiler.

I read about C# once. Have no use for VB.
There is no Visual Studio 2004. 2k3, 2k5, and 2k8.
Well, I've got something fairly recent.
You need Pro to install IIS, the windows web server, but I don't think it will matter for what you want to do.
THAT is what sent me to 'nix years ago.

I didn't know if .NET would prevent you from accessing the 'net for any strange reason based on the version you were using. I'll look into the object you mentioned, too. I'm concerned that, for what should be a simple thing, the setup is going to be long and arduous.
Oct 11 '08 #3
drhowarddrfine
7,435 Expert 4TB
Holy Mother of God!! I just looked at .NET. How do you get anything done with that?! How many years must be devoted to figuring how to write a char to the console?! No wonder Vista is such a bloated pig. I put a crucifix in front of the screen and draped a rosary over it. (And I'm not even Catholic!)

Has anyone heard if Microsoft is going to kill off the Win32API any time soon? I'll just write it with that for now and spend a year or two trying to figure out .NET and and attempt to keep it under a gigabyte.
Oct 12 '08 #4
Curtis Rutland
3,256 Expert 2GB
It's big, but it takes away very much of the manual work of programming. Building GUIs is a snap, compared to C and C++. And the apps can be much lighter than Java, due to the JIT compiler. It's a give and take situation. The Framework is quite large, but you only install it once every version (which come out years apart, and it provides for console, forms, web (both client and server), web service, and windows service programming, and is still growing. It's a whole different philosophy than C programming. You can get as granular as you want, allocating memory manually and using pointers if you want, but you don't have to, because most of that work has been done and wrapped up in nice, easy packages. Plus, the apps aren't that heavy because the whole framework isn't loaded, just the parts that you need, when you need them.

C#, by the way, is similar to Java, in case you wanted to know. Very object-oriented.

AFAIK, they aren't planning on getting rid of the Win32 API for a while.

Printing a char to the console is as simple as Console.Write('a') although I understand the point you were driving at. .NET is actually far simpler for a newbie to pick up, but it's easy for them to get lost in all the Framework and never understand the nuts and bolts of what their programs are actually doing.
Oct 12 '08 #5
drhowarddrfine
7,435 Expert 4TB
It's big, but it takes away very much of the manual work of programming.
Before or after typing System.Network.Console.OS.File.Writing.What?.IForg ot.What.I.Was.Doing(Object.Of.This WhoKnows)?
Oct 12 '08 #6
Curtis Rutland
3,256 Expert 2GB
Well, like I said, a different philosophy.

Luckily enough for both of us, there is room for (and a market for) several kinds of programming.

I'd be more than happy do debate the benefits of each, but let's do that in the cafe, shall we? ;P
Oct 12 '08 #7
drhowarddrfine
7,435 Expert 4TB
Oh, there's no question that the philosophy is "different" but from what I can see, .NET is only for those large companies that can afford to throw tens or hundreds of programmers at it and have each specialize in a certain area. During my search, I read that Microsoft doesn't even use it when they could/should.

EDIT: So after an hour of hunting around for a basic "intro" to all this that doesn't tell me everything but what I want to know, I might be able to puzzle something together after all. I'm sure I'll pop in with questions. I don't need this for a while, and I have to install XP on one of the "upgrade" boxes someone gave me.
Oct 12 '08 #8
Curtis Rutland
3,256 Expert 2GB
Well, I have to disagree with you there, from personal experience.

My company has one (well, one and a half, since I occasionally do development for them) developer, a C#.NET dev. He, in a month and a half, completely migrated our data entry system from RPG/AS400 to ASP.NET/MS SQL with only the help of a SQL DBA to set up the database.
Oct 12 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by john townsley | last post: by
14 posts views Thread by vittorio | last post: by
4 posts views Thread by Kendall Bailey | last post: by
67 posts views Thread by Nimmi Srivastav | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.