Skip to main content
Inspiring
October 26, 2023
Answered

Indirect Interface ExternalObject Creation

  • October 26, 2023
  • 1 reply
  • 328 views

Wondering if anyone has information regarding how to set instance data within an indirect interface (class) built in an externalobject?

I'm following the samples provided from the ESTK SDK, but they don't give any information on how to set instance data from the constructor.

Calling from extendscript, everything "works", but the value returned for "dllpath" isn't what I set it to.
Instead, it comes out as "dllpath".

Not really sure where to go from here. 
I've attached my .cpp file I'm working with, and this is the extendscript function I'm using;

```

function initExtension() {
    // Initial alert to indicate function entry
    alert("Entering initExtension function");
    
    try {
        // Log to check if we reach this point
        alert("About to initialize ExternalObject");
 
        // Initialize ExternalObject
        var helloWorldDll = new ExternalObject("lib:" + "LIB_PATH");
        // Log to indicate successful initialization
alert("initialized DLL");
        var AE = new AEImage("DLL_PATH");
alert("Initialized Class");
AE.dllpath = "Some Value here";
var path = AE.dllpath;
alert(path);
helloWorldDll.unload();
    } catch (e) {
        // Log the exception
        alert("Caught an exception: " + e.toString());
 
        // Return a string indicating failure
        return "Initialization failed";
    }
}
```
This topic has been closed for replies.
Correct answer Trenton5EC4

Ahhh! I figured it out-- I just hadn't set my "get" method, lol.

 

1 reply

Trenton5EC4AuthorCorrect answer
Inspiring
October 26, 2023

Ahhh! I figured it out-- I just hadn't set my "get" method, lol.