MFC and ATL

I have an ATL COM control with one object that has one method.  In that method I want to use a couple of MFC arrays such as CStringArray.  Is this possible, without including all of MFC, or is it possible AT ALL?  If so, what #include do I need?
georitaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chensuCommented:
HOWTO: Add MFC Support to an ATL Project
http://support.microsoft.com/support/kb/articles/Q173/9/74.ASP
0
georitaAuthor Commented:
That is great, but does this mean that the container that I want to put the ATL COM object must have a window?  I had this problem before.  I wanted to put a COM object into a ISAPI dll, but since the dll had no window to pass to the COM object(I was using the ActiveX type COM object)  I could not instantiate the COM object.
Thanks
0
Tommy HuiEngineerCommented:
Instead of using CStringArray, why not use STL?

#include <vector>
#include <string>
using namespace std;

typedef vector<string> StringVector;

// Use StringVector almost exactly like CStringArray


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

chensuCommented:
>does this mean that the container that I want to put the ATL COM object must have a window?

Not necessarily.
0
georitaAuthor Commented:
I meant to give the points to chensu
0
georitaAuthor Commented:
I want to use MFC, cause that is what I know.  But STL could be cool, is there any advantage to using one over the other?
0
chensuCommented:
>I meant to give the points to chensu

Never mind.

>But STL could be cool, is there any advantage to using one over the other?

Using STL will reduce your code size since the MFC libraries won't be linked.
0
georitaAuthor Commented:
Thanks, I am reading about STL right now, it looks pretty straight forward.  Any good web sites for more reading on the subject?
0
chensuCommented:
0
georitaAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.