Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Soulstorm

macrumors 68000
Original poster
Feb 1, 2005
1,887
1
I woke up this morning and I realized that I haven't programmed anything outside of Apple OS X. On Windows, I have only programmed in Visual Basic.

On OS X, I have a strong background with Objective C, and C++, and the concept of Object Oriented Programming in general. I have developed my applications in Cocoa.

What I want to be able to do in Windows is make programs with the help of C or C++. I am also thinking of learning C# in order to use the .NET framework. However, I am completely irrelevant with Windows-specific programming and APIs. I understand that when using C-like languages, there are 2 options: Win32 and .Net framework. What do I need to do to program on both?

I hope you, guys can enlighten me on the subject. What available APIs are there, what resources are available, and what must I do to learn programming in windows? Also, what applications do I need to download? Are there any free IDEs? I don't mind if I have to buy a book or two in order to get started.
 

richard.mac

macrumors 603
Feb 2, 2007
6,292
5
51.50024, -0.12662
in my Computer Science class we used Cygwin to compile and Crimson Text Editor to write C code. In OS X i just use XCode or Text Wrangler to write C code and the Terminal to compile… much simpler :D:apple:

this probably sounds pretty basic but ive only just learnt to write C code for <6 months!
 

Soulstorm

macrumors 68000
Original poster
Feb 1, 2005
1,887
1
in my Computer Science class we used Cygwin to compile and Crimson Text Editor to write C code. In OS X i just use XCode or Text Wrangler to write C code and the Terminal to compile… much simpler :D:apple:

this probably sounds pretty basic but ive only just learnt to write C code for <6 months!

Actually, I should make it clearer:
Programming and building a medium/advanced GUI is a necessity/ I already know how to compile command line programs. What I don't know is how to build a GUI around them on Windows.
 

foidulus

macrumors 6502a
Jan 15, 2007
904
1
Depends on what you want to program

A significant amount of Non-GUI C is portable(ie you can simply recompile to get a windows executable), so you could stick with that.

You could try Java, and discover all the joys(and frustrations) that come when you try to make it cross platform

Microsoft also offers express versions of visual studio for free. Not sure what a lot of the differences are between the express and the expensive pro version, but the express should allow you to get your feet wet.
 
F

fishcove

Guest
Take a look at wxWidgets

What I want to be able to do in Windows is make programs with the help of C or C++. I am also thinking of learning C# in order to use the .NET framework. However, I am completely irrelevant with Windows-specific programming and APIs. I understand that when using C-like languages, there are 2 options: Win32 and .Net framework. What do I need to do to program on both?

I have spent the last six years developing a Windows application in Microsoft Visual C++. I believe there is a free version - Express Edition?

Early on, our company made the decision to go with wxWidgets, a cross-platform gui and tools library, and we have not regretted it. It insulates the developer from the horrors of Win32, or whatever the equivalent is on your platform of choice :cool:, providing a single API across Windows, Mac and Linux. I highly recommend you take a look at it: http://www.wxwidgets.org.

The only real issue we have is that Microsoft tends to focus on .Net with their new technologies, so .Net developers have it a little easier for some things. I'm not really sure where wxWidgets stands with respect to .Net, as we have no plans to go there ourselves at present.

Hope this helps.
 

wrldwzrd89

macrumors G5
Jun 6, 2003
12,110
77
Solon, OH
If you're willing to take the leap to learn a new language, I'm a big fan of Python as a cross-platform programming solution. Windows deployment is considerably easier than for Java - you need only include the small Python runtime DLL with your application. Deployment on Mac OS X and Linux is easy, since these system types have Python installed already.

That said, if you want to make Windows-specific programs with a GUI, I second the recommendation of Microsoft's Visual Studio Express Editions.
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
Actually, I should make it clearer:
Programming and building a medium/advanced GUI is a necessity/ I already know how to compile command line programs. What I don't know is how to build a GUI around them on Windows.

Use something like Qt or GTK+. That way you have a pretty much cross platform application that will help in the long run. Stick to the standard library as much as possible for everything else though.
 

Columbo X

macrumors member
Jun 10, 2007
62
0
UK
Windows GUI development

If you opt for a Windows native GUI API, C++/CLI with Windows Forms is probably the best option going directly from Mac OS to Windows. Windows Presentation Foundation is pretty good as well - it gives a huge amount of control for building interfaces and is DirectX accelerated. MFC (Microsoft Foundation Classes), although maintained in Visual Studio, has really been superseded by .NET. Win32 is still around but I only ever use it now for OpenGL / DirectX demos.
 

newb16

macrumors regular
Feb 27, 2008
100
0
Use something like Qt or GTK+. That way you have a pretty much cross platform application that will help in the long run.
To OP - note that QT is shipped either under GPL or under commercial license, and formally you can't develop part of ( or all ) your qt-dependent code using free(money-wise) version and then buy commercial one to release your product.
 

Soulstorm

macrumors 68000
Original poster
Feb 1, 2005
1,887
1
Thank you all for your answers. I believe that .NET framework development is what I really should do now, since it's becoming increasingly popular, and it's growing rapidly because MS has put much attention to it.

I have some questions though:
1) What is the difference between Win32 API and the .NET framework API apart from that they use different languages?
2) I believe Windows Forms is the graphical API for .NET development with C# (something like Cocoa with Objective C)?
3) Does it offer the same level of features with Win32?
4) Can I wrap some C/C++ code with C# while developing using .NET?
5) Does developing .NET applications require that I learn C#?

Thank you in advance, guys.
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
Thank you all for your answers. I believe that .NET framework development is what I really should do now, since it's becoming increasingly popular, and it's growing rapidly because MS has put much attention to it.

I have some questions though:
1) What is the difference between Win32 API and the .NET framework API apart from that they use different languages?
2) I believe Windows Forms is the graphical API for .NET development with C# (something like Cocoa with Objective C)?
3) Does it offer the same level of features with Win32?
4) Can I wrap some C/C++ code with C# while developing using .NET?
5) Does developing .NET applications require that I learn C#?

Thank you in advance, guys.

1) Think of it this way. Win32 = Carbon, C# .Net = Cocoa.
2) Windows Forms is just a GUI builder I believe available for C#, C++ and VB.
3) No, some things are better done in Win32, but the vast majority of stuff is available in .Net.
4) No idea.
5) No. You can use C#, C++/CLI and Visual Basic.
 

Columbo X

macrumors member
Jun 10, 2007
62
0
UK
Thank you all for your answers. I believe that .NET framework development is what I really should do now, since it's becoming increasingly popular, and it's growing rapidly because MS has put much attention to it.

I have some questions though:
1) What is the difference between Win32 API and the .NET framework API apart from that they use different languages?
2) I believe Windows Forms is the graphical API for .NET development with C# (something like Cocoa with Objective C)?
3) Does it offer the same level of features with Win32?
4) Can I wrap some C/C++ code with C# while developing using .NET?
5) Does developing .NET applications require that I learn C#?

Thank you in advance, guys.

In answer to your questions -

1) Win32 is very old compared to .NET. It provides a C based interface to low level native Windows functions whereas .NET applications run on top of a "virtual machine" called the CLR (Common Language Runtime). This manages the execution of your .NET code (which is compiled into MSIL - Microsoft Intermediate Language). .NET languages compiled this way are referred to as managed lanaguages. Since the MSIL has to be converted to native machine code at runtime, managed languages don't run as fast as languages that compile directly to native machine code, but the efficiency of managed languages has improved!

2) Windows Forms is akin to the collection of UI classes in Cocoa, but you're not limited to C# - you can code Windows Forms applications using C++ and VB.

3) .NET itself offers much more than Win32 in terms of functionality and tools - particularly tools. Visual studio provides a dialog editor for Win32 applications, but .NET GUIs can be built in much the same way as Interface Builder lets you build interfaces.

4) Yes - there are different ways you can do this. First you can call unmanaged code through .NET's interop services. This essentially provides a gateway from managed to unmanaged code (like that written in C++). .NET is very component oriented. It's possible to write native C++ components with a public interface that can then be called from C#. I use this to integrate OpenGL, which is unmanaged, into C# applications.

5) No - C# is pushed a lot by Microsoft, but you can use C++. There is a modification to the C++ standard called C++/CLI. This is normal C++ but Microsoft added new syntax to help differentiate managed and unmanaged pointers for example. C++/CLI allows you to mix managed and unmanaged code seamlessly.

Hope this helps

C
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
3) .NET itself offers much more than Win32 in terms of functionality and tools - particularly tools. Visual studio provides a dialog editor for Win32 applications, but .NET GUIs can be built in much the same way as Interface Builder lets you build interfaces.

As far as I am aware not all of Win32's functionality has been moved over to .Net yet.
 

Columbo X

macrumors member
Jun 10, 2007
62
0
UK
As far as I am aware not all of Win32's functionality has been moved over to .Net yet.

Unknown on exactly how much of Win32 remains to be moved into the .NET frameworks, but .NET has much better support in certain areas like image importing, reflection etc.
 

mcgomer

macrumors newbie
Feb 3, 2008
16
0
Thank you all for your answers. I believe that .NET framework development is what I really should do now, since it's becoming increasingly popular, and it's growing rapidly because MS has put much attention to it.

I have some questions though:
1) What is the difference between Win32 API and the .NET framework API apart from that they use different languages?
2) I believe Windows Forms is the graphical API for .NET development with C# (something like Cocoa with Objective C)?
3) Does it offer the same level of features with Win32?
4) Can I wrap some C/C++ code with C# while developing using .NET?
5) Does developing .NET applications require that I learn C#?

Thank you in advance, guys.

With the advent of .Net 3.0 in 2007 and 3.5 the way you build desktop applications in the .net world has changed. You can still use Winforms, but the way of the future is WPF.

WPF uses a declarative language called XAML to define lots of things about the UI, and then has .Net code for the controller logic. Once you get the hang of it, it really is very powerfull. Everything is styled and templated and changeable. All of the UI controls are completely lookless, and can be styled and templated to be whatever you want them to be.

Animations, 3d, imaging, bitmap effects, typographic rendering of text, document pagination, layouts, media, are all built in. You can easily take a video, map it to a 3d surface and rotate the surface while it is playing, with a reflection of it all below it.

For all of the bad talking of MS on this board, WPF is something that everybody should take a serious look at. Even if just to truly understand where the compitition is currently and where they are going. It changes UI development completely. The stuff you can do with small amounts of code is staggering.

Do a google on wpf, take a look at some example code on sites like http://www.codeplex.com, or http://www.codeproject.com. And when you want to get a bit more adventurous, go look at http://www.codeplex.com/prism and http://www.codeplex.com/transitionals

If you want some books let me know. There are quite a few good ones out there.
 

mcgomer

macrumors newbie
Feb 3, 2008
16
0
Thank you all for your answers. I believe that .NET framework development is what I really should do now, since it's becoming increasingly popular, and it's growing rapidly because MS has put much attention to it.

I have some questions though:
1) What is the difference between Win32 API and the .NET framework API apart from that they use different languages?
2) I believe Windows Forms is the graphical API for .NET development with C# (something like Cocoa with Objective C)?
3) Does it offer the same level of features with Win32?
4) Can I wrap some C/C++ code with C# while developing using .NET?
5) Does developing .NET applications require that I learn C#?

Thank you in advance, guys.

A couple of examples on how you can completely restyle a UI Control using xaml.

http://www.codeproject.com/KB/WPF/XAML_OutlookBar.aspx

and

http://blog.paranoidferret.com/index.php/2008/01/18/the-wpf-tab-control-inside-and-out/
 

iSee

macrumors 68040
Oct 25, 2004
3,540
272

I don't think you're going to impress people used to Interface Builder with a bunch of XML used to define a UI. ;) I'm not knocking WPF (I don't know much about it), but you'd typically use a tool to construct the UI, not straight XAML, right?
 

mcgomer

macrumors newbie
Feb 3, 2008
16
0
I don't think you're going to impress people used to Interface Builder with a bunch of XML used to define a UI. ;) I'm not knocking WPF (I don't know much about it), but you'd typically use a tool to construct the UI, not straight XAML, right?

Yup there are tools. Visual Studio has always had the ability to design the UI's via a WYSIWYG editor. All the way back to the early days. WPF is no exception. But what MS has done is different than Apple at several levels.

With WPF they have extracted the UI design portion of the development workflow so that a graphic artist can now be a first class citizen in the process. Tools like the Expression suite, Blend in particular, http://www.microsoft.com/expression/products/Overview.aspx?key=blend
are targetted towards them. They get to work in a visual environment to design the UI portion of an application. A developer can still do all this themselves, using either Blend or Visual Studio, but larger development organizations can have a team of UI Designers doing what they do best, with tools targetted towards them, with a clean iterative workflow in the overall development of the app. The designer can create modularized elements that have all of the features that WPF gives them ( Animations, transitions, gradients, custom controls, page flows, etc. ) and never touch code. A developer comes along and adds the plumbing and business logic. If the development process requires the UI designer to step back into the process, they can without undoing what the developer has done.

Blend and the Visual Studio UI tools are not Interface builder. Interface builder creates files that the developer doesnt go into and modify by hand. In the MS world, all of the visual designers by products have been code, or xaml. That allows the developer to tweak the results by hand if the designer does not provide for customizations that are required by the app.

Which is better? I am not going to make a value judgment, because I dont care. Neither is perfect. Each is suited to the environment it is targeted for. They are what they are. If you are going to develop for the Apple world, you learn xCode, IB, Objective-C and you deal with it. If you are going to develop for the MS World, you learn their way and you deal with it. As a software mercenary, I go where the money is. <grin> And I use the tools that are best suited for the job.

I prefer to not have tools do magic. I need to understand the underpinnings of what is going on at the root level. Visual tools tend to hide the learning process. So, until I feel comfortable that I understand what the tool is creating I tend to not use it. Once I am fluent in the technology, I use the tools for the roles they were created for, but I can then use them to my advantage as opposed to being at their mercy. Like learning C from the command line before using xCode. Once you understand what the tools are doing, they amplify your ability to do productive code instead of putting you into a straight jacket.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.