| View previous topic :: View next topic |
| Author |
Message |
Wessel
Joined: 12 Oct 2010 Posts: 57
|
Posted: Tue May 24, 2011 11:15 am Post subject: v1.2 ScriptInterfaceUnit.h(1589): error C2198: too few args |
|
|
When Compiling a ForexTester 2.7 Script with Microsoft Visual C++ Express (version 10.0.030319.1 ) the include ScriptInterfaceUnit.h (version 1.2) returns an error on line 1589 that the call has to view arguments and it fails to build.
The Script I am compiling is an empty Script template
| Code: |
#include <windows.h>
#include "ScriptInterfaceUnit.h"
#include "TechnicalFunctions.h"
// External variables
//-------------------------------------------
// Initialization procedure
//-------------------------------------------
EXPORT void __stdcall Init(){
ScriptShortName("Bug Cant compile me");
ScriptDescription("Bug Cant compile me");
}
//---------------------------------------------------------------------------
// Execute script
//---------------------------------------------------------------------------
EXPORT void __stdcall Execute()
{
Print("Hello World");
}
//-------------------------------------------
// Deinitialization procedure
//-------------------------------------------
EXPORT void __stdcall Done()
{
}
|
Bellow are the errors produced by the v1.2 of the ScriptInterfaceUnit.h:
| Code: |
1>------ Rebuild All started: Project: AutoMM TradeNow, Configuration: Debug Win32 ------
1> AutoMM TradeNow.cpp
1>c:\users\wessel\dropbox\development\forex tester 2\scripts\c++\bug\scriptinterfaceunit.h(968): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy'
1>c:\users\wessel\dropbox\development\forex tester 2\scripts\c++\bug\scriptinterfaceunit.h(1589): error C2198: 'TGetIntegerFunc' : too few arguments for call
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
|
The previous interface 1.0 compiled clean, a workaround is by removing lines 1586 till 1591, but we lose the Timeframe functionality
Please Fix! Attached is a minimal script example and full Visual C++ project that demonstrates the failure
Wessel |
|
| Back to top |
|
 |
Wessel
Joined: 12 Oct 2010 Posts: 57
|
Posted: Tue May 24, 2011 11:52 am Post subject: |
|
|
Fixed it.
Attached is the fixed version + several enhancements that makes coding scripts in FT more C++ like than C like
| Code: |
//-----Get current timeframe--------------------------------------------------
// BUGFIX Wessel, solution taken from IndicatorInterfaceUnit v1.12
/*int Timeframe()
{
if (rec.Timeframe == NULL) return -1;
return rec.Timeframe();
}
*/
int Timeframe()
{
if (rec.pTimeframe == NULL) return -1;
return int(rec.Timeframe(rec.pTimeframe));
} |
Cheers,
Wessel |
|
| Back to top |
|
 |
mspen
Joined: 10 Sep 2008 Posts: 8 Location: San Diego
|
Posted: Thu Aug 25, 2011 5:28 pm Post subject: |
|
|
Thanks for the fix. It now compiles clean. Just wondering if posting an example of the .def file would be useful. I made it up by reviewing the items in the ScriptInterface.h that were exported. The .def file that I am using is:
--------------------------- start
LIBRARY samplescript
EXPORTS Init
Execute
Done
ReplaceStr
IntrfProcsRec
--------------------------- finish
An empty script sample loaded and ran compiled with this.
I am using the following to compile:
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200) |
|
| Back to top |
|
 |
|