Skip to main content
Participant
February 7, 2015
Question

End an external object in extendscript

  • February 7, 2015
  • 1 reply
  • 2316 views

Hi

In Extendscript I create an ExternalObject object. It is an DLL in Visual C++. I call a function in it and obtain the result then I unload it.

var basiceo = new ExternalObject("lib:" + "d:/file.dll");
alert(basiceo.getAverage(10, 20, 0));
basiceo
.unload();

This is just like the sample in Extendscript Toolkit SDK.

Now if I make change in the DLL code, I can not build(compile) it any more. It gives me this error:

error LNK1104: cannot open file 'd:/file.dll'

It seems that the file has not been closed. If I close the Extendscript, I can build(compile) the code without error.

How can I finish the external object in extendscript correctly?

Thanks

This topic has been closed for replies.

1 reply

Community Expert
February 7, 2015

Did you try with the close() method of the File Class?

CS3 JS: File

Uwe

i_akbariAuthor
Participant
February 7, 2015

In what way? Could you tell me an example?

close("d:/file.dll");

Error: close is not a function

File.close("d:/file.dll");

Error: File.close is not a function

basiceo.close();

Error: basiceo.close is not a function


Community Expert
February 7, 2015

I'm on Mac OSX, so I'm not sure about the file path syntax here.
Also, if at all it is possible to open a dll kind of file by ExtendScript.

But you could try the following:

//I'm not sure about the file path here,

//because I'm on Mac OSX.

//Basically it should work this way:

var myFile = new File("d:/file.dll");

if(myFile.exists){

    myFile.open("r"); //Read only

    myFile.close();

    };

Uwe