AnsweredAssumed Answered

VRf-Need help - double

Question asked by VRFuser on Feb 20, 1996
subject:       No proper function of double in VEE
( reprint because of failure during the delivering last mail in VRf )
     I would like to ask you for help in solving the below mentioned
  problems with double in HP VEE.

     I'm creating DLL for Windows 3.1 by Microsoft C 7.00. There are
no problems with creating the DLL (I follow the recomendations for  
compiler and linker options described in HP Product Note 2120-3(HP  
VEE for Windows) ). The problems occur during the running DLL with  
double as a function parameter under the VEE. We have a HP VEE
version 3.1  and 3.12 release on 2.2.95 and 7.7.95 respectively.

     Almost nothing is possible in the case of using double as a
  parametr of function (called both by value and by reference). There
  are 2 types of errors:
  a) General Protection Fault in vee.exe or in *.dll in the programs
  like these:
  long FAR CDECL Test(double FAR *data)
     double *pom;
   *data=2*(*pom);     // GENERAL PROTECTION FAULT ('GPF') in .dll
      {   return ((long)0);}
  double FAR CDECL Test(double data)
     double dd;
     { return(dd);} // GPF in VEE.EXE
  long FAR CDECL Test(double FAR *data)
   double *pom;
   if((*data)   (double)(*pom))  // GPF !
    { return((long)10);}
    { return((long)1);}
  b) Returning the constant value independent on the result   
     of function:  
  long FAR CDECL Test(double FAR *data)
    *data = (double) ((*data)+1.);  
    { return((long)0);}
    // returns *data=4419.3424 e249, for subtraction -4419...
  long FAR CDECL Test(double FAR *data)
     double pom;
  pom /=2;    
  {return ((long)0);}
  // returns multiples of 4419.. acording to the *data value assigned
  in VEE  
  On the other side this function works properly:
  long FAR CDECL Test(double FAR *data)
    return((long) 0);
      The demonstrated examples prove there is something wrong in
  treatment of double in HP VEE. Please send me your view on these
  problems and the recomendation how to overcome them on my email
  address if you want:
     Thank you very much for your recomendations and experience !

         Best regards

                 Ondrej Valter
                  Czech Technical University of Prague
                  Czech republic