Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

COM via luacom
Started by Jaime Alemany Mar 01 2019 10:09 AM

5 replies to this topic
win32 com luacom
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Jaime Alemany

[GLOBAL: userInfoPane.html]
Jaime Alemany
  • Enthusiast

  • 65 posts
  • Corona SDK

Hello there,

 

I've been trying to use the luacom plugin in Win32.

 

Interestingly enough, executing my Corona project from the simulator via ZeroBrane studio (my tool of choice), it works great, and I can access any COM object in my computer.

 

If however I execute the project directly from the sImulator, or after building it for Win32, I get a Corona runtime error: "error loading module luacom from c:\...luacom.dll. The specified module cannot be found:" (nothing more informative)

 

 

Is this something worth pursuing? (I'm really interested, but...)

 

With the current situation of Corona - being open source, but then marketplace and hosted plugins, even more, corona native for iOS and Android (but not Win32)... 

 

Thanks!



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,081 posts
  • Enterprise

I'm not familiar with that plugin, but I believe, you need to put the .dll file in the same folder with your main.lua.

 

Rob



[TOPIC: post.html]
#3

Jaime Alemany

[GLOBAL: userInfoPane.html]
Jaime Alemany
  • Enthusiast

  • 65 posts
  • Corona SDK

Hi Rob - thanks for the quick reply!

 

I tried that, actually tried every combination.

 

It works if the simulator is executed from Zerobrane (dll placed in the project folder), it does not if standalone or if the project is built.

 

If you don't see any reason for this to fail to work, I'll keep trying - any ideas most welcome :-)

 

All I get is this: http://lunatico.es/tmp/luacom.PNG



[TOPIC: post.html]
#4

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 853 posts
  • Corona Staff

Hello!

 

So, if you want your plugin to be used in Simulatory you should place dll inside "%AppData%\Corona Labs\Corona Simulator\Plugins".

 

If you want your Windows built app to use a plugin, DLL should be near the built app exe file.

 

Problem you have on screenshot is different kind: your DLL is failed to load for some reason (not that file was not found). Basically, module "luacom" could not be loaded from "plugin_luacom.dll".

 

In most cases it means that your plugin_luacom.dll relies on some other DLLs which should be placed near your built windows app.



[TOPIC: post.html]
#5

Jaime Alemany

[GLOBAL: userInfoPane.html]
Jaime Alemany
  • Enthusiast

  • 65 posts
  • Corona SDK

Thanks Vlad,

 

the plugin is not "mine", is one publicly available since a lot of years: http://luaforge.net/projects/luacom/

 

I'll check the source code and see what I can find out. What puzzled me was the fact it ran perfectly from Zerobrane - still puzzled  :P

 

I'll report back here.



[TOPIC: post.html]
#6

Jaime Alemany

[GLOBAL: userInfoPane.html]
Jaime Alemany
  • Enthusiast

  • 65 posts
  • Corona SDK

Ok, it was not so hard.

 

I recompiled luacom on my VS Community 2017, taking some header files and lua.lib from the Corona distribution.

 

Challenge has been to "bin2c" a lua file to a C file (never did this before, but went smooth).

 

Now it works like a charm, I can access any COM object from within my Corona application. Really happy!  :D

 

If anyone is interested, the dll is available from http://lunatico.es/dev/luacom.dll

 

Documentation, etc: http://lua-users.org/wiki/LuaCom




[topic_controls]
[/topic_controls]