views:

57

answers:

1

Hello,

I want to develop windows C/C++ program, but i need in it functionality like a Viewbox from .NET WPF. But i don't want buying Visual Studio platform because it has this control.

Can anyone tell me something replacment for this?

I want to do window, which after resizing, resizes its contents with good proportion (images buttons labels etc)

Can anyone help me with this? Thanks

+2  A: 

Good news #1

You don't have to buy Visual Studio: Microsoft gives it away for free.

Just go to www.microsoft.com/express and download a copy. Microsoft explains in this FAQ that the free Visual Studio version can be used for commercial purposes.

I strongly recommend you download a copy of Visual Studio and use it for all of your development work. It is much better than the alternatives. However...

Good news #2

If you really don't want to use Visual Studio for some reason (like your micro-managing boss says no), you can still use WPF's Viewbox control. As long as you have the NET Framework 3.0 or above installed, you can compile and run any WPF project. And since a WPF project is just text files, you can edit these with any text editor. For example, you can edit a WPF project with Eclipse, Emacs or Notepad.

When you're ready to compile, just run the "MSBuild" command in the directory containing your WPF project and it will create a .exe (or .dll) for you that you can use. To get started (if you really don't want to use Visual Studio), download any sample WPF application from the web, hack out everything you don't want, and add what you do want.

Good news #3

WPF's Viewbox is not limited to Windows: You can use most of WPF, including the Viewbox control, on MacOS, Linux, and several mobile phone OSes.

To do this, when you create your project just say you want a "Silverlight" project instead of a "WPF" project. This will result in an application that can run on many operating systems, not just Windows. You will not have all WPF functionality, but you will have most of it, including Viewbox.

Of course, if you only want to deploy to Windows you should create a WPF project so you'll get full the WPF feature set.

Good news #4

All WPF functionality works just as well with C/C++ as with any other NET Framework language. Just make sure you compile with the /clr command-line option. Of course you won't be able to use partial classes, since C/C++ doesn't have them, but a well-designed WPF application doesn't need these anyway.

Ray Burns
He wants to write a C/C++ app though, I'm not sure how useful making a Silverlight project would be for him.
rossisdead
Actually you can run a C/C++ application on Silverlight as long as it compiles to pure managed code. That said, since he is writing a Windows app I would encourage him to stick with WPF instead of using Silverlight.
Ray Burns
@Ray Burns: Thanks!! Great answer!
Svisstack