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)

COM Category for safe connection pointer implementation

Somebody introduced COM category to me for safe and better connection pointer implementation, sink objects register themselves under a custom category, sink source enumerate that category and invoke each instance for the event. The idea was date back to 1997
http://msdn.microsoft.com/msdnmag/issues/01/07/c/
Understanding Categories with CatView, Getting Toolbars in 256 Colors

Monday, April 03, 2006

ASP reports error "Cannot load Type Library specified in the METADATA tag"

ASP reports error "Cannot load Type Library specified in the METADATA tag"
Active Server Pages error 'ASP 0224' Cannot load TypeLib /LM/W3SVC/1/ROOT/SC20UI/global.asa, line 3 Cannot load Type Library specified in the METADATA tag.
Step 1: look up registry to see if path of the typelib is valid.
step 2: check permission of the tlb to see if EVERYONE has read only and execute permission to it.

Exclude files when comparing source

*.obj
*.sbr
*.tlh
*.tli
*.pdb
*.pch
*.ncb
*.scc
*.vssscc
*.idb
*.exp