I can't seem to call the C++ DLL from VB6.
I keep getting the error "..wrong passing convention..". REALLY need some help. The C++ and the VB6 snippets look like:
(I am not using a .DEF file. The platform is VS 7.0.)

the C++ code snippet... (and below this the vb6..)

#include "stdafx.h"
#include <math.h>

extern "C" __declspec(dllexport) int __stdcall interp(double *t,double *ap,double *ip,double *f, double *o2,double *ac,double *dp,double *po2);

void ReadMap();
bool map();
void pntsel(double inputVar,int Nvar1,double * var1,int &h1,int &h2,int &step1);
bool fintrpl(double &q,double a,double c,double a1,double b1,double c1);

extern "C" BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}

double array[7280][8] = {
{420,2,12,0.1,11.22,0.13,0.1,53.8},
{420,2,12,0.15,13.66,0.18,0.1,56.2},
{420,2,12,0.2,15.11,0.23,0.2,57.6},
{420,2,12,0.25,16.09,0.28,0.2,58.5},
{420,2,12,0.35,17.31,0.39,0.3,59.5},
. .
. .
. .
. .
. .
. .
{685,16,90,40,15.15,57.39,17.1,34.6}
};
double inputTemp;
double inputAtmPres;
double inputPres;
double inputPrdFlow;
// Dim SepPurity(20, 20, 20, 20) As Single ' Purity
double SepPurity;
// Dim SepAFlow(20, 20, 20, 20) As Single ' Air consumption
double SepAflow;
// Dim SepdeltaP(20, 20, 20, 20) As Single ' Delta p
double SepdeltaP;
// Dim SepPPurity(20, 20, 20, 20) As Single 'Perm purity
double SepPPurity;

int num_temp = 8;
int num_air_press = 7;
int num_sep_press = 10;
int num_flow = 13;
int Nvar1;
int Nvar2[20];
int Nvar3[20][20];
int Nvar4[20][20][20];
double var1[20];
double var2[20][20];
double var3[20][20][20];
double var4[20][20][20][20];
double var5[20][20][20][20];
double var6[20][20][20][20];
double var7[20][20][20][20];
double var8[20][20][20][20];



int __stdcall interp(double *t,double *ap,double *ip,double *f,
double *o2,double *ac,double *dp,double *po2)
{
inputTemp = *t;
inputAtmPres = *ap;
inputPres = *ip;
inputPrdFlow = *f;
ReadMap();
if(!map())
return -1;
*o2 = SepPurity;
.
.
.


the vb code snippet

Option Base 1

Private Declare Sub interp Lib "NewInterp.dll" (ByRef inputTemp As Double, ByRef inputAtmPres As Double, ByRef inputPres As Double, ByRef inputPrdFlow As Double, ByRef ProdPurity As Double, ByRef AirConsump As Double, ByRef PressDrop As Double, ByRef PermPurity As Double)

Sub Test()
'
Dim inputTemp As Double ' Input Temp
Dim inputAtmPres As Double ' Input Atm Pres
.
.
.
Call interp(inputTemp, inputAtmPres, inputPres, inputPrdFlow, ProdPurity, AirConsump, PressDrop, PermPurity)
.
.