Discover Packages
github.com/nyaosorg/glua-ole
package
module
Version:
v0.0.0-...-b885836
Opens a new window with list of versions in this module.
Published: Apr 2, 2025
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 2 modules, 1 package
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
glua-ole
The bridge library between GopherLua
and go-ole .
Using
package main
import (
"fmt"
"os"
"github.com/yuin/gopher-lua"
"github.com/nyaosorg/glua-ole"
)
func main() {
L := lua.NewState()
defer L.Close()
L.SetGlobal("create_object", L.NewFunction(ole.CreateObject))
L.SetGlobal("to_ole_integer", L.NewFunction(ole.ToOleInteger))
err := L.DoString(`
local fsObj = create_object("Scripting.FileSystemObject")
local folder= fsObj:GetFolder("C:\\")
local files = folder:_get("Files")
print("count=",files:_get("Count"))
for f in files:_iter() do
print(f:_get("Name"))
f:_release()
end
folder:_release()
files:_release()
fsObj:_release()
`)
if err != nil {
fmt.Fprintln(os.Stderr, err)
}
}
local OBJ=create_object() creates OLE-Object
OBJ:method(...) calls method
OBJ:_get("PROPERTY") returns the value of the property.
OBJ:_set("PROPERTY",value) sets the value to the property.
OBJ:_iter() returns an enumerator of the collection.
OBJ:_release() releases the COM-instance.
local N=to_ole_integer(10) creates the integer value for OLE.
Expand ▾
Collapse ▴
Documentation
¶
func CreateObject(L *lua.LState) int
CreateObject creates *lua.LState-Object to access COM
func ToOleInteger(L *lua.LState) int
ToOleInteger converts LNumber to integer which can be used by OLE parameter only.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.