durs / node-activex

Node.JS Implementaion of ActiveXObject
MIT License
329 stars 62 forks source link

Is possible getting a COM Object from a pointer? #47

Open voxsoftware opened 5 years ago

voxsoftware commented 5 years ago

Example I have a windows DLL that have a function that returns an integer (pointer to COM Object). How transform this to one usable object with this library?

voxsoftware commented 2 years ago

@OSjoerdWie I see is merged your PR. How use in javascript code? Also is possible make reverse? I mean, get a pointer from a node object and cast to COM object in other app/language?

OSjoerdWie commented 2 years ago

@voxsoftware please refer to issue 103. It contains a reference to some code how such a pointer was obtained in Excel VBA.

With respect to the reverse: I would not know.

voxsoftware commented 2 years ago

@OSjoerdWie thanks, but my question is for the code un javascript side. I don't see documentation about this. Supposing I have yet the pointer, how convert to usable object using winax?

OSjoerdWie commented 2 years ago

Hi @voxsoftware, please refer to my below Typescript snippet:

import { Object as ActiveXObject } from "winax";

...

const comObjectPointer = new Uint8Array(bytes); // bytes is an array representing your pointer value
const object = new ActiveXObject(comObjectPointer));