node-activex icon indicating copy to clipboard operation
node-activex copied to clipboard

Is possible getting a COM Object from a pointer?

Open voxsoftware opened this issue 6 years ago • 4 comments

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 avatar Feb 28 '19 03:02 voxsoftware

@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?

voxsoftware avatar Dec 14 '21 18:12 voxsoftware

@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.

OSjoerdWie avatar Dec 15 '21 07:12 OSjoerdWie

@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?

voxsoftware avatar Dec 15 '21 15:12 voxsoftware

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));

OSjoerdWie avatar Dec 15 '21 16:12 OSjoerdWie