Search found 9 matches

by mminsel
Fri Jun 16, 2023 11:10 am
Forum: Scripting
Topic: LoadDocument returns nil and not a MohoDoc
Replies: 4
Views: 356

Re: LoadDocument returns nil and not a MohoDoc

if you have a new (unnamed) document as the active tab when you run the script, you'll get the empty string back. also load returns a document object, so you'll need print(newDocument:Path()) not print(tostring(newDocument)) Hi hayasidist, Thanks for your reply. The thing is, that LoadDocument retu...
by mminsel
Fri Jun 16, 2023 10:00 am
Forum: Scripting
Topic: LoadDocument returns nil and not a MohoDoc
Replies: 4
Views: 356

LoadDocument returns nil and not a MohoDoc

Hi, I have the following issue: When I run the following code: print(moho.document:Path()) local newDocument = moho:LoadDocument("C:/path/to/file.moho") print(moho.document:Path()) print(tostring(newDocument)) I'll get the following printouts: "" "" nil Moho opened the ...
by mminsel
Fri May 05, 2023 11:02 am
Forum: Scripting
Topic: Is there a way to close a SimpleDialog
Replies: 4
Views: 473

Re: Is there a way to close a SimpleDialog

Hi Sam, That was my suspicion. I've now created a c++ lua module that allows to close the modal dialog using a workaround: extern "C" __declspec(dllexport) int closeMenuWindow(lua_State * L) { lua_lock(L); const char* windowName = luaL_checkstring(L, -1); lua_pushnil(L); lua_unlock(L); #if...
by mminsel
Tue May 02, 2023 10:09 pm
Forum: Scripting
Topic: Is there a way to close a SimpleDialog
Replies: 4
Views: 473

Is there a way to close a SimpleDialog

Hi,

Is there a way to close a SimpleDialog, which was started with DoModal?

I've tried to call OnOK(), OnCancel() and EndDialog(dlg) but they were all undefined (nil).

I would like to close the modal dialog, after another button than the OK/Cancel button was clicked.
by mminsel
Tue May 02, 2023 11:29 am
Forum: Scripting
Topic: Initialize ScriptingInterface in a script or stable method to retrieve a ScriptingInterface instance (moho object)
Replies: 0
Views: 2356

Initialize ScriptingInterface in a script or stable method to retrieve a ScriptingInterface instance (moho object)

Hi, Does anyone know, if there is a way to manually initialize the ScriptingInterface? It seems, that if I use a SimpleDialog in combination with the HandleMessage dialog, the moho-object, that is passed to the Run method gets deleted. Alternatively I could use the scripts-HandleMessage method, but ...
by mminsel
Mon Nov 25, 2019 5:10 pm
Forum: Feature Request Discussions
Topic: Socket Support for HTTP(S) Requests
Replies: 1
Views: 3570

Socket Support for HTTP(S) Requests

Hi, It would be nice to get support for socket communication, especially for http and https requests into Moho. This way one could make requests to a web-based production database directly. I tried to get this to run by building the following repos: https://github.com/diegonehab/luasocket https://gi...
by mminsel
Mon Nov 25, 2019 4:58 pm
Forum: Scripting
Topic: Lua 3rd-Party Libraries Not Loading
Replies: 17
Views: 4628

Re: Lua 3rd-Party Libraries Not Loading

I switched to version 13 of Moho. What I get is: With Lua 5.2.4 and 5.2.0 x64 I still get an immediate crash. with Lua 5.2.3 and 5.2.1 x64 : Error: Multiple Lua VMs detected. Googling this error gave me two possible reasons: 1. The version of Lua is not exactly the same as the one I'm linking agains...
by mminsel
Fri Nov 15, 2019 1:50 pm
Forum: Scripting
Topic: Lua 3rd-Party Libraries Not Loading
Replies: 17
Views: 4628

Re: Lua 3rd-Party Libraries Not Loading

I actually recompiled it in x32: I don't get the
Error loading module: /path/to/cpath/socket/core.dll: The module wasn't found.
but only the
Error loading module: /path/to/cpath/socket/core.dll:
So the problem persists
by mminsel
Fri Nov 15, 2019 12:19 pm
Forum: Scripting
Topic: Lua 3rd-Party Libraries Not Loading
Replies: 17
Views: 4628

Lua 3rd-Party Libraries Not Loading

Hi, I have the following issue: I'm running Moho 12 on Win 10. Moho 12 contains Lua version 5.2 x64 (I think.. as _VERSION returns 5.2 and running prebuild libraries with x32 gave me an dll error). So I compiled the Lua-socket module linking it against version 5.2.4 x64. I installed it to a dedicate...