davidm / luacom

Microsoft Component Object Model (COM) binding for Lua
http://lua-users.org/wiki/LuaCom
Other
116 stars 51 forks source link

0x80020011 Does not support a collection. #3

Open mdauphin opened 12 years ago

mdauphin commented 12 years ago

I just try luacom, and It's a great module! But I have a problem to call C++ IDispatch property object. My IDL interface : interface IData : IDispatch {..} interface IDataDiff : IData { [propget, helpstring("Nombre")] HRESULT nbPoints([out, retval] ULONG* pVal); ... };

My C++ code : IData pData = InitializeDataDiff(); IDispatch pdisp = NULL; pData->QueryInterface( IID_IDispatch, (void*)&pdisp ); luacom_IDispatch2LuaCOM(L, (void ) pdisp); lua_setglobal(L, "data");

My LUA code: value = data:nbPoints() -- value = data.nbPoints -- return function !

I've COM HRESULT 0x80020011 Does not support a collection. I check in tLuaCom::call at line 340 the Invoke seem to be correct. My C++ COM code return S_OK, but in OLE microsoft code return x80020011.

Thanks !