Support Board
Date/Time: Thu, 28 Nov 2024 00:43:13 +0000
CreateFile - Error
View Count: 1584
[2014-10-25 19:39:58] |
Bitcoinadvisor - Posts: 14 |
Hello, I have written a C++ study DLL to do some processing, at certain times I want to generate a file with some data I have collected from a chart. I am taking the scsf_WriteBarDataToFile example from Study6.cpp I have added the code to my study but, I get an error on the following lines: hFile = CreateFile(OutputPathAndFileName.GetChars,GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL, NULL); Error 2 error C3867: 'SCString::GetChars': function call missing argument list; use '&SCString::GetChars' to create a pointer to member c:\sierracharts\my custom study dll\my custom study dll\mycustomstudy.cpp 600 1 My Custom Study DLL So issue here is I want to create a file and write some data to it, the error above is preventing me from doing that. Does anyone have any suggestions please. thanks Andrew |
[2014-10-25 20:05:34] |
Sierra Chart Engineering - Posts: 104368 |
Here is the corrected code: hFile = CreateFile(OutputPathAndFileName.GetChars(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); 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: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
[2014-10-25 20:28:34] |
Bitcoinadvisor - Posts: 14 |
Hello, Thanks for the fast response, I updated that line of code. However, I have a new error this time: 7 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\SierraCharts\My Custom Study DLL\My Custom Study DLL\MyCustomStudy.cpp 599 22 My Custom Study DLL regards Andrew |
[2014-10-25 20:35:18] |
Sierra Chart Engineering - Posts: 104368 |
Looks like you are compiling using a preprocessor flag which supports wide, 2 byte, characters. This kind of problem is not within the scope of our support. You want to make sure the compiler is set to use only single byte characters. 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: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2014-10-27 16:56:32
|
[2014-10-25 20:43:34] |
Bitcoinadvisor - Posts: 14 |
ok, I will look into that setting. thanks Andrew Date Time Of Last Edit: 2014-10-25 20:44:33
|
To post a message in this thread, you need to log in with your Sierra Chart account: