HRESULT LoadTypeLib(const OLECHAR FAR *szFile, ITypeLib FAR* FAR *pptlib);
LoadTypeLib is the foundation of COM. Any call to LoadTypeLib will register the type library if it is not already registered. That's why Microsoft invented this function:
HRESULT LoadTypeLibEx(LPCOLESTR szFile, REGKIND regkind, ITypeLib** pptlib);
Any function is better with an "Ex" on the end. If you just want to go spelunking around in a type library and don't want it registered then use LoadTypeLibEx and pass in REGKIND_NONE as the regKind parameter. Problem is if your type library references other type libraries and they are in the current directory and they are not registered then they will be after this call, but the type library you passed in as the szFile parameter won't get registered.
2 comments:
Cheers -- this helped me during my revision for Microsoft's 70-536 exam.
@Ed, glad it helped!
Post a Comment