Click here to Skip to main content
15,868,340 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Updated 27-Dec-12 2:06am
v4
Comments
Richard MacCutchan 27-Dec-12 8:27am    
What type is T?
sandeepyes 27-Dec-12 8:39am    
IDispatch
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
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.
Member 11037121 18-Jul-17 6:35am    
Are you integarting how to call javascript from iWebBrowser using c++ as given in source code http://www.codeproject.com/Articles/2352/JavaScript-call-from-C

1 solution

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900