How do I do COM and ActiveX with Win32

Posted on 2002-07-17
Last Modified: 2013-11-25
Dear Expert-Exchange Friends

I’ll keep this short and simple.

When using VC++ Win32 programming, as in, no heavy MFC involved at all, how do you create or instantiate ActiveX controls? Will I be using CreateWindowEx()? What is the procedure of instantiating COM objects such as MSFlexGrids and all the other funky ActiveX controls that are not standard things like buttons, edit boxes etc.

How do I on the other hand create my own custom ActiveX controls?

I know this is not easy without MFC, but harder the work, the better the experience gained. In fact, I think MFC sucks, its too bulky and the heavy overhead drives me beyond insanity.

I would love it if you guys could direct me to some cool links.

Thanx plenty
Question by:josamoto

Accepted Solution

jimwasson earned 100 total points
ID: 7161257
Chapter 3 of the WROX book "Professional COM Applications with ATL" by Sing Li and Panos Economopoulos goes through writing a simple ActiveX control from scratch -- no MFC or ATL (until chapter 4).

Expert Comment

ID: 7162132
I first started programming COM a few years ago using VC++ Active Template Library (ATL). It is very good. I got a good jump-start from the following link:

You will be up and running simple components today if you start with the tutorial:

My advice to you is to start by using ATL, but read the code that the ATL wizard generates so you can see what is going on.

Expert Comment

ID: 7162149
Also, this book proved valuable to me, especially in explaining how to write a full control with ATL without MFC.

Another book I found very helpful is this one:

LVL 11

Expert Comment

ID: 7376092
Dear josamoto

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept


comment(s) as an answer.


Expert Comment

ID: 7419920
Force accepted

** Mindphaser - Community Support Moderator **

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Process running 3 47
best sources to up-to-date in C++? 8 70
Where to obtain Oracle Data Provider for .NET 3.5 7 47
Create a path if not exists 7 68
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now