NSIS Com and interfaces
Hi. I'am write a script for adding component category
!define CLSCTX_INPROC_SERVER 1
!define ICatRegister_ID "{0002E012-0000-0000-C000-000000000046}"
!define CLSID_StdComponentCategoryMgr "{0002E005-0000-0000-C000-000000000046}"
!define CATID_OPCDAServer20 "{63D5F432-CFE4-11d1-B2C8-0060083BA1FB}"
!define CategoryDescription "OPC Data Access Server Version 2.05"
!define CLASSID "{20690CDC-4490-4F8A-87ED-87F1DE2D9404}"
var CatRegister
var CatInfo
!Macro CreateComponentCategory
System::Call "ole32::CoCreateInstance(g '${CLSID_StdComponentCategoryMgr}', i 0, i ${CLSCTX_INPROC_SERVER}, g '${ICatRegister_ID}', *i $CatRegister)i .R0"
${If} $R0 != 0 #S_OK
Abort "some text ICatRegister"
${EndIf}
#PCatInfo
System::Alloc 276
pop $CatInfo
System::Call '*$CatInfo(g "${CATID_OPCDAServer20}", i 1033, *&w256 "${CategoryDescription}")'
System::Call "$CatRegister->3(i 1, i $CatInfo)i .R0"
${If} $R0 != 0 #S_OK
Abort "some text ${CategoryDescription}"
${EndIf}
!MacroEnd
CoCreateInstance work fine.
But CatRegister->RegisterCategories always return error.
Why is happen?
PS: sorry for bad english