Forex Tester Forum (Professional Training Software for Traders) Forum Index Forex Tester Forum (Professional Training Software for Traders)

Back to main site   Risk disclosure
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

v1.2 ScriptInterfaceUnit.h(1589): error C2198: too few args

 
Post new topic   Reply to topic    Forex Tester Forum (Professional Training Software for Traders) Forum Index -> Bug reports
View previous topic :: View next topic  
Author Message
Wessel



Joined: 12 Oct 2010
Posts: 57

PostPosted: Tue May 24, 2011 11:15 am    Post subject: v1.2 ScriptInterfaceUnit.h(1589): error C2198: too few args Reply with quote

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 Sad

Please Fix! Attached is a minimal script example and full Visual C++ project that demonstrates the failure


Wessel
Back to top
View user's profile Send private message
Wessel



Joined: 12 Oct 2010
Posts: 57

PostPosted: Tue May 24, 2011 11:52 am    Post subject: Reply with quote

Fixed it.
Attached is the fixed version + several enhancements that makes coding scripts in FT more C++ like than C like Wink

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
View user's profile Send private message
mspen



Joined: 10 Sep 2008
Posts: 8
Location: San Diego

PostPosted: Thu Aug 25, 2011 5:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Forex Tester Forum (Professional Training Software for Traders) Forum Index -> Bug reports All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group