Login Page - Create Account

Support Board


Date/Time: Thu, 13 Dec 2018 07:32:02 +0000



ACSIL - DLL cannot be opened for writing

Support Request:
[2018-11-20 10:08:29]
User19165 - Posts: 168
Hi Sierra,

New issue for me just starting today and no idea why. Last week I was working on this indicator without issue but today every time I am going to compile this while Sierra is running then Visual Studio gives me the error message:

"1>LINK : fatal error LNK1168: cannot open ..\..\..\Sierra_DEV\Data\Theoretical Average.dll for writing"

I'm using the latest version of Sierra 1842 but previously was using 1823 without issue until today. I can do a clean then full solution rebuild and same issue. If I close sierra down and then try to do a build, no problem. The indicator also has sc.FreeDLL = 1

What could I be missing here?
[2018-11-20 10:26:47]
User907968 - Posts: 37
Check the release note for V1837 -

https://www.sierrachart.com/index.php?page=doc/Whats_New.php#SCVer1837

sc.freedll not used, dll must be manually released to allow build in external program such as VS
[2018-11-20 10:34:33]
User19165 - Posts: 168
Thanks for the reply, but this started to happen in version 1823 as well. Like I said, no problem last week. I just looked up the logs you referenced and then looked at my version 1842, not really sure what it is suggesting I do? I am building this from with visual studio, not within sierra...
[2018-11-20 11:01:59]
User907968 - Posts: 37
If you are building DLL in \sierra\data directory with sierra running, then you cannot write to it as it will be in use (DLL is no longer unloaded due to sc.FreeDLL = 1 command)

1) Release DLL -
Analysis - Build Custom Studies DLL
Build - Release All DLLs and Deny Load

2) Build your study in VS or whatever

3) Reload DLL -
Analysis - Build Custom Studies DLL
Build - Allow Load DLLs
[2018-11-20 19:04:04]
Sierra Chart Engineering - Posts: 66930
You need to follow through the instructions here when using an external build tool:
https://www.sierrachart.com/index.php?page=doc/AdvancedCustomStudyInterfaceAndLanguage.php#ModifyingAdvancedCustomStudyCode
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
[2018-11-21 02:18:45]
Kiwi - Posts: 198
Admin,

Would it be possible to make Release All DLLs and Allow Load DLLs selectable as keyboard shortcuts please?

That would allow SC users to just press a keyboard combo before recompilation (so they could combine to run one command to do everything). I imagine some people would be shutting compilers, opening SC and jumping all over their screens currently - a keyboard shortcut would keep everything tidy.

Thanks
Date Time Of Last Edit: 2018-11-21 02:37:04
[2018-11-21 05:24:38]
User19165 - Posts: 168
Keyboard shortcuts for this would be very convenient.
[2018-11-21 07:58:37]
User864893 - Posts: 10
For VS Developers would it be possible to trigger the DLL release & load from an outside script/programm so that it could be included in pre and post compile scripts. Think that would be an ideal solution.
[2018-11-21 09:23:15]
Sierra Chart Engineering - Posts: 66930
We can add keyboard shortcuts but there are UDP Port commands for this that you can use:
https://www.sierrachart.com/index.php?page=doc/UDPAPI.html

Let us know how those work because they have not been tested.

This is available in version 1846 to be released in a few minutes.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-11-21 09:23:27
[2018-11-21 11:21:17]
User864893 - Posts: 10
Perfect! release and load works fine via UDP. Compiled a short exe based on your UDPAPI example which has been added to pre/post compile.

Just did a quick and dirty test with 1846 :-)

Thanks a lot
[2018-11-22 04:42:04]
Kiwi - Posts: 198
Would you be kind enough to add Release All & Allow Load All to the UDP interface please?

Between Linux & Wine the directory paths get confused enough that SC can't use them even in the menu driven mode. Same in the UDP mode (don't release & if I release all, can't load one).
[2018-11-22 05:59:51]
Sierra Chart Engineering - Posts: 66930
Between Linux & Wine the directory paths get confused enough that SC can't use them even in the menu driven mode.
Provide us more information so we can resolve. We are not aware of this.

Would you be kind enough to add Release All & Allow Load All to the UDP interface please?
Yes.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
[2018-11-22 21:54:00]
Kiwi - Posts: 198
Manual version. 1 chart with multiple studies from the same dll (KiwX.dll on my ramdisk, /home/john/zRamdisk/SierraData , all my data is stored in ram for green / noise / ssd life improvement).

Original: https://i.imgur.com/pfg25fZ.png

Analysis Build Build Release all & insert to reload chart: https://i.imgur.com/jcROAzv.png

Analysis Build Build Load all ... returns us to the original


So now one file. Note that the SC directory is SC64 as shown here (but the data is set to the ramdisk directory above):

https://i.imgur.com/KtA8VeG.png

Opening Choose DLL to release shows: https://i.imgur.com/eYGsOR4.png

Using Folder I navigate to the ramdisk: https://i.imgur.com/GD6qSsu.png

Select kiwX_64.dll then choose Open (window goes away)


FOUND THE PROBLEM .. Initially I discovered that closing on kiwX.dll would work so I thought that having the 32 bit dll in the directory was causing a problem. So I deleted it. So picture above but without kiwX.dll in the directory. Opened SC again ... choose release kiwX_64.dll ... didnt work!!! So tried changing name in open box to kiwX.dll (even though not present) and when I selected open it unloaded the link to _64.dll & the next insert resulted in a blank chart.

I suspect this is a SC64 only problem that you can easily fix. Or it might be better to add a note to the documentation to skip the _64 ... actually is it necessary to include the path given that we're forced to use the data directory? Then the command could just be:

sock.sendto(b"RELEASE_DLL--KiwX.dll", ("127.0.0.1", 22903))
Date Time Of Last Edit: 2018-11-22 23:09:11
[2018-11-22 22:30:31]
Kiwi - Posts: 198
Just confirming the same using the socket ... in python I needed to load/unload KiwX.dll not KiwX_64.dll. It might be worth including the python script commands as an example in the docs as well as C++; as usual Python tends to make it easy.

https://i.imgur.com/83IcdQA.png
Date Time Of Last Edit: 2018-11-22 22:41:10
[2018-11-23 00:12:41]
User654912 - Posts: 19
UDP works for me.

Basic powershell script for users who might not have python installed. Run with .\udpunload.ps1

udpunload.ps1
---
$client = new-object net.sockets.udpclient(0)

$peerIP = "127.0.0.1"
$peerPort = "22904"

$send = [text.encoding]::ascii.getbytes("RELEASE_DLL--C:\SierraChart\Data\x.dll")

[void] $client.send($send, $send.length, $peerIP, $peerPort)

$client.close()
Exit
[2018-11-27 00:12:50]
TedMar - Posts: 46
Why is not a CheckBox for permanet enable "Release All & Allow Load All" ?

Mybe User864893 or any one post here example howto add UDPAPI to pre/post compile in VS?
and UDPAPI.exe source code file Example too.
[2018-12-07 07:53:26]
User19165 - Posts: 168
Sierra,

In post #12, you responded to post #11 saying that there would be a release / load all command, did this get implemented yet? I note the UDP documentation page does not make mention of this.
[2018-12-07 09:39:27]
Sierra Chart Engineering - Posts: 66930
Why is not a CheckBox for permanet enable "Release All & Allow Load All" ?
We do not understand this. This is not making sense to us. This cannot be permanent.

In post #12, you responded to post #11 saying that there would be a release / load all command, did this get implemented yet?
Yes this has been released and it is in 1849 and the documentation is now updated.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2018-12-07 09:39:39

To post a message in this thread, you need to login with your Sierra Chart account:

Login


Login Page - Create Account