Login Page - Create Account

Support Board

Date/Time: Tue, 23 Apr 2024 01:05:52 +0000

[User Discussion] - problem with sc.AddMessageToLog

View Count: 2081

[2016-12-09 01:29:10]
User210074 - Posts: 63

#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: 104368
You need to do it like this:

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

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


Login Page - Create Account