Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 4th May 2012, 12:47   #1
_Vasek_
Junior Member
 
Join Date: May 2012
Posts: 3
NSIS Com and interfaces

Hi. I'am write a script for adding component category

code:

!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
_Vasek_ is offline   Reply With Quote
Old 4th May 2012, 14:08   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,777
System::Call '*$CatInfo(&g16 "${CATID_OPCDAServer20}", i 1033, &w128 "${CategoryDescription}")' is probably more correct

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 4th May 2012, 14:29   #3
_Vasek_
Junior Member
 
Join Date: May 2012
Posts: 3
No its don't help

There is one piece
if i write
code:
MessageBox MB_ICONINFORMATION|MB_OK $CatRegister

Message show with empty string
And if i write
code:
MessageBox MB_ICONINFORMATION|MB_OK $CatInfo

Message show integer value(i think this is pointer of struct)
This is normal?
And how i can see interface pointer?
_Vasek_ is offline   Reply With Quote
Old 4th May 2012, 16:07   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,777
System::Call "ole32::CoCreateInstance(g '${CLSID_StdComponentCategoryMgr}', i 0, i ${CLSCTX_INPROC_SERVER}, g '${ICatRegister_ID}', *i $CatRegister)i .R0" should be System::Call "ole32::CoCreateInstance(g '${CLSID_StdComponentCategoryMgr}', i 0, i ${CLSCTX_INPROC_SERVER}, g '${ICatRegister_ID}', *i.r1)i .R0" + StrCpy $CatRegister $1

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 5th May 2012, 07:12   #5
_Vasek_
Junior Member
 
Join Date: May 2012
Posts: 3
Now it's work
Thank you very much
_Vasek_ is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump