views:

303

answers:

5

How do you develop UI in MFC? do you use any free libray, or usually develop from scratch? There are always so many DLL files in a C++ developed software, what are them used for ?

What's the difference between MFC ActiveX Control and MFC DLL ?

+1  A: 

MFC (Microsoft Foundation/Frustration Class) is an old approach of Microsoft to provide an Framework to C++ developers. In those days it was the only framework offered by Microsoft so the approch is very old (Win95 I think).

The MFC is a toolbox consisting of String, Gui, Controls etc... CString, CWindow, CTreeControl, ...

In addition it contained an component framework (ActiveX) and Gui based component framework ActivX Controls that may include all of the parts of the toolbox.

All the functionallity is hosted in the mfc??.dll and other dll taht have become part of the Microsft OS itself and contains a lot of compatibility stuff of Windows. (Most of the applications including Word Excel, ... are implemented using MFC).

Today I wouldn't suggest to start using MFC anymore. If you have to care about MFC you are doomed but I would suggest to use one of the newer hype things of MS or use Qt or whatever Gui based toolbox.

Most of them are more modern than MFC.

Totonga
Thanks for your advice, but i want to try to use MFC, and i think it's performance is better, and the user don't need to install .net framework or other things.
MemoryLeak
Microsoft still seems to care about MFC - http://msdn.microsoft.com/en-us/library/bb982451.aspx
jussij
Microsoft will still care about MFC for another decade of years. You can't kill it. Its the base of most win applications. But still its no fun writing MFC applications. Even if there is a new feature pack.
Totonga
+1  A: 

Get yourself a good book to begin with. There are still some third parties controls if you do not mind spending a bit of money. Finally, codeproject has hundreds of MFC examples.

DanDan
+3  A: 

Visual Studio 2008 enhances MFC by adding the 'Feature Pack'. This allows you to create MS Office 2007 style GUIs (amongst others), complete with a Ribbon Bar.

http://msdn.microsoft.com/en-us/library/bb982354.aspx

I cut my C++ teeth using MFC, but I'd recommend you look at Qt instead - it's a much more modern framework plus you get cross-platform support (Linux, Mac, etc.) for free. MFC is pretty much a dead framework IMHO (the Feature Pack was bought in and is actually a cut-down version of the BCG library.)

http://www.bcgsoft.com/

If you want to stick with MFC there is another popular GUI framework, by CodeJock:

http://www.codejock.com/products/overview.asp?platform=mfc

Rob
MFC is hardly dead. In fact, MS is actively supporting it through the release of the VS2008 service pack.
Darren Ford
There is a massive MFC legacy in the form of millions of lines of code out there in the world, so of course MS will support it. However, as for moving the framework forward? I don't think this is very likely now. Perhaps 'dead' is too strong but it's certainly a framework at the end of it's life IMHO.
Rob
A: 

The standard book for learning MFC is this one.

Since you don't list the DLLs that are troubling you, I can't comment on them. However in native code it's common practice for frequently-used functions to be separated out into DLLs.

An ActiveX control is a COM (Component Object Model) "chunk" of functionality, designed to be accessible from multiple languages. COM has no specific connection with MFC, other than the fact that MFC can use COM components like any other MS product.

MFC DLLs come in two types, extension and regular. Regular DLLs are just like any other DLL. An extension DLL is more tightly integrated with MFC, can only be used with MFC applications, and can export MFC classes and functions.

Bob Moore
A: 

How do you develop UI in MFC?

More often than not the MFC GUI will be defined as a Windows resource file that is compiled using the Windows resource compiler and edited using the MFC specific resource file editor that is built into Visual Studio.

But since the resource file is just plain text it can also be created and edited by hand inside any text editor.

What's the difference between MFC ActiveX Control and MFC DLL ?

MFC is nothing more than a set of C++ library classes designed to wrap around existing Windows technology.

So for example the MFC ActiveX control is nothing more than a Windows ActiveX Control written in MFC and likewise the MFC DLL is a Windows DLL written in MFC.

I would also recommend taking some time to also learn a little about the underlying Win32 layer. In reality MFC is only a very thin layer over the top of standard Win32 so any knowledge of Win32 always comes in handy.

jussij