Giter Site home page Giter Site logo

Comments (10)

durs avatar durs commented on July 28, 2024 1

Hi, found this example:

// Create COM object from JS
var obj = new winax.Object({
    test: function(v) { return v*2; }
});

// Convert COM IDispatch pointer to Variant array
var varr = new winax.Variant(obj, 'uint8[]');

// Convert Variant array to JS array address bytes
var arr = new Uint8Array(varr.valueOf());
console.log(arr);

// Create new COM object from IDispatch pointer (address bytes)
var obj2 = new winax.Object(arr);

// Call test method
console.log(obj2.test(2));

from node-activex.

somanuell avatar somanuell commented on July 28, 2024

Ok, fund code in disp.cpp line 547:

	// Use supplied dispatch pointer
	else if (args[0]->IsUint8Array()) {
        size_t len = node::Buffer::Length(args[0]);
        void *data = node::Buffer::Data(args[0]);
        IDispatch *p = (len == sizeof(INT_PTR)) ? (IDispatch *) *(static_cast<INT_PTR*>(data)) : nullptr;
        if (!p) {
            isolate->ThrowException(InvalidArgumentsError(isolate));
            return;
        }
		disp.Attach(p);
		hrcode = S_OK;
	}

Issue now is "HOW TO" to pass the pointer from JavaScript ???

from node-activex.

somanuell avatar somanuell commented on July 28, 2024

@durs Hi. Thanks for merging the PR. Do you plan to release on npmjs.com?

from node-activex.

durs avatar durs commented on July 28, 2024

Ok, I'll make a release, while I don't plan to change anything else

from node-activex.

somanuell avatar somanuell commented on July 28, 2024

Hi, again. When I built winax with npm i against node 14.18.3 in january 2022, I got a node_activex.node of approx 185 kB. Today when I npm i winax against node 14.20.0 I get a node_activex.node of 560 kB! What am I missing here?

from node-activex.

durs avatar durs commented on July 28, 2024

I don't know, last release in my environment 240 Kb with Node 18.13 and Visual Studio 2022 (v143)

from node-activex.

somanuell avatar somanuell commented on July 28, 2024

What is your build method?

from node-activex.

durs avatar durs commented on July 28, 2024

npm install
then tried rebuild binding.sln but got the same result

from node-activex.

somanuell avatar somanuell commented on July 28, 2024

Same here! npm install ==> node_activex.node is 544 KB
rebuild binding.sln ==> node_activex.node is 544 KB....
node --version ==> v14.20.0
Visual Studio 2022 (v143)
I AM LOST!

from node-activex.

somanuell avatar somanuell commented on July 28, 2024

LOL with nodejs v18.15.0 32 bits I am now at 194 KB!
Something very weird is happening with the LIBs used while linking against nodejs v14.20....

from node-activex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.