How can I import a function with variable arguments from my DLL?

 

Hi:


I have a function defined as a varags function in my DLL as follows:


// ============================================================
// GetAverage
// ============================================================
__declspec(dllexport) double__stdcall GetAverage(...)
{
  double avg = 0;
  int num = 0;
  va_list vl;
  .
  .
  .
  va_end( vl );
  return avg;
}

I want to do something like this in MQL4 code:


#import "test.dll"
   double GetAverage(...);
#import

void stuff()
{
   double a1 = GetAverage(1,1,2,3,5,8,13);
   double a2 = GetAverage(5,5,6,6,6,6,6,9,1,7,7);
}


Unfortunately the "..." syntax is not supported and there doesn't seem to be a formal argument syntax for declaring variable argument functions. At least I didn't see it in the documentation or the book.


This capability would also be very useful for defining one's own print function.


Is there a way to do this in MQL4?


Cheers,


Joe

Reason: