PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Qs about STL and MFC

Okie dokie. It's come to my understanding that STL is not supported by Windows CE, because Windows CE does not support exceptions. That's fine and dandy, as there seems to be a 3rd party port (which lacks <iostream>, sadly enough). However, MFC for Windows CE seems to contain the things I was looking for in the STL anyway, I'll probably end up using it instead. But that leads me to a few Qs;

- For the life of me, I cannot find out what header files I need to include to use certain classes (CPtrList and CFile just to name a couple). And no, I have never used MFC before. And yes, I have checked the msdn documentation.

- Are there any drawbacks to using MFC? Compatibility issues, etc?

- Does MFC offer anything similar to auto_ptr<>?

- Is there a reason why I should use the 3rd party port of the STL over MFC? Aside from speed (which is probably questionable in both cases), I can't think of one off the top of my head. Perhaps I need to be enlightened.

Thanks in advance.
Pejo Software - Per · 07 Jan 2004, 08:27 UTC
- For the life of me, I cannot find out what header files I need to include to use certain classes (CPtrList and CFile just to name a couple). And no, I have never used MFC before. And yes, I have checked the msdn documentation.

The simplest way to include MFC in your project is to use the project wizard. It is possible to include MFC without using the wizard but it might require you to do some tweaking (Adding som defines and so on).

- Are there any drawbacks to using MFC? Compatibility issues, etc?

Your application will be less portable.

- Does MFC offer anything similar to auto_ptr<>?

No

- Is there a reason why I should use the 3rd party port of the STL over MFC? Aside from speed (which is probably questionable in both cases), I can't think of one off the top of my head. Perhaps I need to be enlightened.
Portability, speed (I think CString has some issues for example).

Please note that STL will also have portability issues and if you wan't your code to be super portable you'll probably have to write your own containers and algorithms in ANSI C.

I would reccomend going for STLPort unless you plan to use a lot of Windows GUI stuff because then MFC should be your choice.
Use STLport. Do not use MFC.
The STL port it is. Thanks.
I agree with what others have posted, and would recommend that you only use MFC for extensive Windows GUI applications. It's most useful for generating custom Windows GUI controls, layering new functionality on top of existing Windows controls using the OOP paradigm. Anytime you have to integrate tightly into a specific GUI you are committing to it in a big way, so using MFC is not an issue as far as portability goes in that case.

I definitely wouldn't use it just for ancillary stuff like CList, CString, CArray, etc.

Dan East