Support Board
Date/Time: Thu, 03 Apr 2025 19:18:34 +0000
Post From: problem with sc.AddMessageToLog
[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; SCDLLName("CalendarEc") SCSFExport scsf_CalendarEc(SCStudyInterfaceRef sc) { SCInputRef Date = sc.Input[0]; if(sc.SetDefaults) { sc.GraphName="CalendarEc"; sc.StudyDescription="Economic Calendar"; sc.AutoLoop = 1; sc.FreeDLL = 1; SCString File; File.Format("C:\\SierraChart\\Data\\CalendarEc.txt",sc.Symbol.GetSubString(4,0).GetChars()); Date.SetString(File); return; }//END default ifstream File(Date.GetString()); if(File){ string DateEc; while(getline(File,DateEc)){ sc.AddMessageToLog(DateEc,1); //cout << DateEc << endl; } } else{} }// 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" CalendarEc.cpp 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 |