Login Page - Create Account

Support Board


Date/Time: Wed, 04 Feb 2026 10:30:59 +0000



Post From: Getting non-stop errors when trying to put in the protection code for a custom DLL study

[2026-02-04 05:18:21]
User854802 - Posts: 45
Hi

I have been building a custom study for absorption using orderflow tools in Sierra Chart. I have used Grok to help me figure out some of the code nuances and I have a very good working version with all the features and options that I want and I have the DLL files for it, with a custom settings for ES and NQ. I am aware that SC does not provide direct support for programming or for AI code, but for me this is the only way I can get it done with my limited knowledge. So I figured I would try to ask other users here.

I am interested in distributing it, but I want to add the "sc.IsUserAllowedForSCDLLName" variable to protect my code before sharing it. I've run like 20 different tests trying to just add this code into the already working versions of the studies and I keep getting non stop error messages.

At Grok's suggestion I ran a very simple code just to test the protection code:

#include "sierrachart.h"

SCDLLName("Test_Auth_Check")

SCSFExport scsf_TestAuth(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
sc.GraphName = "Test Auth Check";
return;
}

// This is the line that keeps failing in your other files
if (!sc.IsUserAllowedForSCDLLName("Test_Auth_Check"))
{
sc.AddMessageToLog("Unauthorized - Contact provider", 1);
return;
}

sc.AddMessageToLog("Authorized - Study loaded OK", 1);
}


After running it, I still get the same error message I am always getting on my main files:


-- Starting remote build of Custom Studies Source files: Test_Auth_Check.cpp. 64-bit --
22:05:35Allow time for the server to compile the files and build the DLL.Server: https://build.sierrachart.com
The remote build is complete.
The build failed.
Test_Auth_Check.cpp: In function 'void scsf_TestAuth(SCStudyInterfaceRef)':
Test_Auth_Check.cpp:15:56: error: expression cannot be used as a function
15 | if (!sc.IsUserAllowedForSCDLLName("Test_Auth_Check"))
| ^Failed to generate the dll file.-- End of Build -- 22:05:38


I've been trying for 3 days to figure this out and it just keeps giving me an error in something related with the code protection function.

Any help or insights would be greatly appreciate.

Thanks
Date Time Of Last Edit: 2026-02-04 05:19:41