79655285

Date: 2025-06-05 23:25:18
Score: 1
Natty:
Report link

I ended up using LuaBridge to resolve this issue. For the most part I got away with using the standard pattern of

getGlobalNamespace(L)
    .beginClass<CClass>("Class")
        .addData("number", &CClass::number)
        .addProperty("string", CSTRING_GETTER(CClass, CClass::string), CSTRING_SETTER(CClass, CClass::string))
        .addFunction("func", &CClass::func)
    .endClass();

Though as you can see I needed to add a conversion macro (basically an overcomplicated type-cast style getter/setter that LuaBridge can understand) to switch between CString and std::string for the string variables. I also needed to do a few functions using the Lua C API standard using the "addCFunction()" component of LuaBridge for functions that had too many arguments, or multiple inputs. The thing that took the most time was simple writing wrappers for the functions I had that took or returned variables that were BSTR, BOOL, DATE, LPDISPATCH, etc. But that was more tedious than problematic.

In the end though, everything is working as expected so thanks to everyone else for their help/advice.

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Blacklisted phrase (0.5): I need
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: N Krueger