views:

169

answers:

2

Right now, I want to develop a C++ program. And the UI design is the difficult issue. my question is: 1. is there any good practice for developing a well structed c++ program ? 2. is there any good practice for developing UI in c++? 3. I usually heard of Activex in C++, can it use to encapsulate a UI, and is good for maintain after software is finished.

Thanks in advance !

+3  A: 

Hi Dennis,

I try to give some answers to your questions:

1) Good Program Structure

This really depends on what matters most - cost of development, ease of deployment/update, maintainability, target machine requirements. It is hard to give you a good answer because the topic is so large. I suggest this as a good place to start reading:

Software Design

(2) Good Practice for developing UI

This really does depend on what technology you are going to use. If you're running on Windows, you have a handful of options:

a) Win32 API programming

This is the hardest and involves writing code to call functions like 'CreateWindow' to create your UI a piece at a time.

b) ATL - Active Template Library

This is a bit easier than (1) but uses really hardcore C++ - you need to know about Templates, Multiple Inheritance, some Patterns and you'll end up learning Win32 anyway.

c) Microsoft Foundation Classes (MFC)

If you have Visual C++ or Visual Studio, you can create an MFC project which has dialog editors and a UI framework to more easily create rich user interfaces. Microsoft Outlook is written in MFC.

d) Use C#.net

If you have Visual Studio, then I would recommend that you make your UI in Visual C# using the Forms Designer tool as it is quite easy to create a flexible and responsive UI. You can still do all your business logic in C++ and link to it from the C#. It is also the newest of all these options.

3) ActiveX

For all options (a), (b), (c), (d) you can make an ActiveX control to make your program re-usable. You can also make an ActiveX control in Visual Basic.

Hope this helps!

James

JBRWilkinson
+2  A: 

You might also consider using Qt - crossplatform UI framework for C++.

Ray