Login Page - Create Account

Support Board

Date/Time: Thu, 17 Jun 2021 16:53:32 +0000

[User Discussion] - problem with sc.AddMessageToLog

[2016-12-09 01:29:10]
User210074 - Posts: 62 | Ending Date: 2021-06-25

#include <windows.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <ctime>
#include "sierrachart.h"
using namespace std;
SCSFExport scsf_CalendarEc(SCStudyInterfaceRef sc) {
SCInputRef Date = sc.Input[0];
  if(sc.SetDefaults) {
    sc.StudyDescription="Economic Calendar";
    sc.AutoLoop = 1;
    sc.FreeDLL = 1;
    SCString File;
   }//END default
ifstream File(Date.GetString());
string DateEc;
     //cout << DateEc << endl;
}// End Function

-- Starting build of Custom Studies Source files: CalendarEc.cpp. -- 02:20:42

C:\WINDOWS\system32\cmd.exe /C "C:\Dev_SierraChart\ACS_Source\VisualCCompile.Bat"

C:\Dev_SierraChart\ACS_Source>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
C:\Dev_SierraChart\ACS_Source\CalendarEc.cpp(26): error C2664: 'void s_sc::AddMessageToLog(const SCString &,int)': cannot convert argument 1 from 'std::string' to 'const char *'
C:\Dev_SierraChart\ACS_Source\CalendarEc.cpp(26): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
-- End of Build -- 02:20:45
I do not know how to fix the problem with the sc.AddMessageToLog function to display the date in MessageLog
[2016-12-09 01:42:14]
Sierra Chart Engineering - Posts: 96589 | Ending Date: 2022-04-10
You need to do it like this:

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:

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.

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


Login Page - Create Account