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?
 
Tommy HuiConnect With a Mentor EngineerCommented:
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
 
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
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
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
All Courses

From novice to tech pro — start learning today.