Onega

a lot of VC++ posts, a few C# posts, and some miscellaneous stuff

Tuesday, April 11, 2006

VC++ 2003 instruction for Q223139 How To Add Support for Hosting VBScript to an ATL Application

following the instructions of Q223139 to create a project via VC++ 2003, it won't work for the instruction is VC++ 6.0. The following steps are required for VC++ 2003:
1. when create the project, uncheck "Attributed" checkbox
2. HRVERIFY(LoadTypeLib(L"AtlClientApp.tlb", &ptLib), "LoadTypeLib");
copy the typelib to the same directory as the executable, rename _AtlClientApp.tlb to AtlClientApp.tlb
3. change CLSID_MyObject to __uuidof(CMyObject) in OnClickedOK
ptLib->GetTypeInfoOfGuid(__uuidof(CMyObject)/*CLSID_MyObject*/, &pMySite->m_pTypeInfo);//(Onega) VC++ complains CLSID_MyObject was not defined
4. Don't add Fire_MyEvent() method to CMyObject , modify ClientDlg.h instead.
//pMyObject->Fire_MyEvent();
pMyObject->MyEvent();
5. in ClientDlg.h, comment out the following line
//#include "AtlClientApp.h"
the problem was reported by hyamw (林锋) and answered by masterz in csdn (http://community.csdn.net/Expert/TopicView3.asp?id=4559533)

0 Comments:

Post a Comment

<< Home