davidm / luacom

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

handle properties using DESCKIND_VARDESC (e.g. StdFont) #1

Open davidm opened 13 years ago

davidm commented 13 years ago

This fails:

std=luacom.createobject("StdFont")
std.Name="Arial"
std.Size=26
Object.Font=std

Reported by Pablo Garcia. See http://lua-users.org/lists/lua-l/2010-12/msg00009.html :

The failure in your example seems to be a problem in LuaCOM. Here, IDispatch::Invoke [1] with DISPATCH_PROPERTYPUT in tLuaCOM::call is failing with error DISP_E_BADPARAMCOUNT. The reason is that DISPPARAMS [2] is not being properly initialized because the ITypeComp::Bind in tLuaCOM::getFUNCDESC is not returning a DESCKIND_FUNCDESC but rather a DESCKIND_VARDESC, which we currently are not handling. It's not clear to me why the type info of many "properties" apparently are methods (FUNCDESC's), while others like in StdFont are variables (VARDESC's), but we'll probably need to handle this.