I'm attempting to recreate the example posted at:
http://en.wikipedia.org/wiki/OLE_Automation#Examples
My code is choking at GetIDsOfNames... Can anyone add some insight?
PHP Code:
/*
!define IID_StdOle '{00020430-0000-0000-C000-000000000046}'
!define IID_IDispatch '{00020400-0000-0000-C000-000000000046}'
!define IID_IUnknown '{00000000-0000-0000-C000-000000000046}'
!define IID_NULL '{00000000-0000-0000-0000-000000000000}'
!define CLSCTX_SERVER 0x015
!define LOCALE_SYSTEM_DEFAULT 0x800
*/
DetailPrint CLSIDFromProgID
System::Call `Ole32::CLSIDFromProgID(w,&g16)i ("Excel.Application",.r0).r2`
DetailPrint "ERR=$2"
DetailPrint "CLSID=$0"
DetailPrint CoCreateInstance
System::Call `Ole32::CoCreateInstance(g r0,i 0,i ${CLSCTX_SERVER},g '${IID_IDispatch}',*i .r1) i .r2`
DetailPrint "ERR=$2"
DetailPrint GetIDsOfNames
System::Call `$1->GetIDsOfNames(g ${IID_NULL},w "Visible",i 1,i ${LOCALE_SYSTEM_DEFAULT},*i .r3)i .r2` ;<-- Errors here... :'(
DetailPrint "ERR=$2" ; <-- I'm getting error 0x80004002 (AKA E_NOINTERFACE)
DetailPrint $$3=$3