You are not logged in.
Pages: 1
Hi @mpv,
It's OK now!
I still think it's perfect to register over 255 functions for the defineClasses.
I have a few classes they have more than 255 functions.
how ever it's great now!
Thanks!
Hi @mpv
I download the dlls from x32: https://unitybase.info/downloads/mozjs-45.zip
Then I define SM52 on the global level, and it can run now, but in the COM object it shows an error.
I used the UBComBridge from @unitybase\com-bridge,
var dm = createobject("dm.dmsoft");
Log(dm.Ver());
This code is ok with SM45, but in the SM52 it will show
dm.Ver is not a function .
.
Is there something wrong with SM52?
I also want know how to clear the moudles loaded, I just used it Free every times and Create a New TSMEngine...
Ok, Great!
Thank you!
Can we use SpiderNode? https://github.com/mozilla/spidernode
@mpv:
Thanks for your help!
I download some lib from http://registry.unitybase.info
@unitybase/stubs and @unitybase/base etc..
but they can't work well with SyNode, is there any thing I need change?
example: when I use http.get("http://www.xxx.com"); it will show _http.writeEnd is not a function,
I have defineClasses THTTPClient but the THTTPClient not have the "writeEnd" method.
@mpv:
It's OK now, thk you!
Ok, Thank you!
I can't modify the COM, it is theothers,
So I must modify the CallFunction.
Thank you again!
The other question, where can I download more nodejs lib?
@mpv:
Very thanks!
But I have a problem with the var out parameters, like:
function GetClientSize(hwnd: Integer; out width: OleVariant; out height: OleVariant): Integer;
I can't get the width and height with this function, can I get the param name from the js?
JS Code:
var width = 0;
var height = 0;
var ret = com.GetClientSize(hwnd,width,height);
//width and height always 0
Ok,
I want Register a COM DLL in JS, and I have import it, it have more than 300 methods,
Is there some idea I can Call the Mothods like:
var a = new TMyClass(); a.abc();
Thanks!
Hi,
In SyNode defineClass can't register a Class with more than 255 methods?
How can I register a Class with more than 255 methods?
The Code In SyNode.pas
/// Define a Delphi class as JS class (prototype), so it can be created via new:
// engine.defineClass(TmyObject, TSMNewRTTIProtoObject);
// and in JS
// var myObj = new TmyObject();
// - Class will be exposed in the aParent javaScript object, if aParent is omitted - in the global object
// - AProto parameter can be a TSMCustomProtoObject descendant (TSMSimpleRTTIProtoObject, TSMNewRTTIProtoObject)
// WARNING - possible prototypes count is limited to 255 - JSCLASS_GLOBAL_SLOT_COUNT = 76 for SM45,
// so it is better to use a bindings, add where a native functions and wrap it in class into the JavaScript
// see `fs.js` for sample.
function defineClass(AForClass: TClass; AProto: TSMCustomProtoObjectClass; aParent: PJSRootedObject = nil): TSMCustomProtoObject;
Hi,
In SyNode defineClass can't register a Class with more than 255 methods?
How can I register a Class with more than 255 methods?
The Code In SyNode.pas
/// Define a Delphi class as JS class (prototype), so it can be created via new:
// engine.defineClass(TmyObject, TSMNewRTTIProtoObject);
// and in JS
// var myObj = new TmyObject();
// - Class will be exposed in the aParent javaScript object, if aParent is omitted - in the global object
// - AProto parameter can be a TSMCustomProtoObject descendant (TSMSimpleRTTIProtoObject, TSMNewRTTIProtoObject)
// WARNING - possible prototypes count is limited to 255 - JSCLASS_GLOBAL_SLOT_COUNT = 76 for SM45,
// so it is better to use a bindings, add where a native functions and wrap it in class into the JavaScript
// see `fs.js` for sample.
function defineClass(AForClass: TClass; AProto: TSMCustomProtoObjectClass; aParent: PJSRootedObject = nil): TSMCustomProtoObject;
Pages: 1