Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
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
Edited 27-Dec-12 2:06am
v4
Comments
Richard MacCutchan at 27-Dec-12 8:27am
   
What type is T?
sandeepyes at 27-Dec-12 8:39am
   
IDispatch
Richard MacCutchan at 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 at 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
http://www.codeproject.com/Articles/2352/JavaScript-call-from-C
I have included files WebPage.h and WebPage.cpp from above link for my project and facing the problem.

1 solution

Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,745
1 OriginalGriff 6,696
2 CPallini 5,315
3 George Jonsson 3,599
4 Gihan Liyanage 2,650


Advertise | Privacy | Mobile
Web02 | 2.8.140922.1 | Last Updated 28 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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