Click here to Skip to main content
13,596,952 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have created a simple MFC activex control. I have also added class "Add ATL Support to MFC" for the above project using Add->Add Class. now if I use CComPtr< T> x; its showing CComPtr undefined even though I have included atlbase.h and header files.
Posted 27-Dec-12 1:21am
Updated 27-Dec-12 2:06am
Richard MacCutchan 27-Dec-12 8:27am
What type is T?
sandeepyes 27-Dec-12 8:39am
Richard MacCutchan 27-Dec-12 8:49am
Why not update your question with some proper detail. Passing one word answers really does not offer anything in the way of explanation.
sandeepyes 27-Dec-12 22:51pm
I dont think its the problem with the type or variable. In Visual Studio its saying "CComPtr" is undefined, one of my friend told that the header files and their classes and functions are not loaded, so its not recognizing those keywords.
and the declaration is
CComPtr< IDispatch> spDoc;
I have used the source code from
I have included files WebPage.h and WebPage.cpp from above link for my project and facing the problem.
Member 11037121 18-Jul-17 6:35am
Are you integarting how to call javascript from iWebBrowser using c++ as given in source code

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Problem solved. I just added ATL namespace as "using namespace ATL;" and the problem solved. thanks to all who helped.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.180621.3 | Last Updated 28 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100