lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Nov 29, 2010 at 8:15 AM, Pablo Garcia <pablomorpheo@gmail.com> wrote:
> Hi, it's possible to use StdFont with LuaCom?
> I've tried a lot of things, like:
>
> std=luacom.createobject("StdFont")
> std.Name="Arial"
> std.Size=26
> Object.Font=std

This way seems to work:

  std = luacom.CreateObject("StdFont")
  std:setName("Arial")
  std:setSize(26)

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.

[1] http://msdn.microsoft.com/en-us/library/ms221479.aspx
[2] http://msdn.microsoft.com/en-us/library/ms221486.aspx