Hi,
To retrieve data from my edit box, I decided to add a member function to my dialog's class, viz:
i then used the function in my math function, to get the value of the edit box:
While the code compiles without error, i still obtain a debug assertion failure in wincore.cpp!!
Is there a better way of calling my getrw(double x) in my math fxn without having this problem?
Thank you.
To retrieve data from my edit box, I decided to add a member function to my dialog's class, viz:
Code:
double CKuchukDlg::getrw(double x)
{
//Get Data from the edit box
CString strx;
GetDlgItemText(IDC_WELLRAD,strx);
x = atof(strx);
return x;
}
i then used the function in my math function, to get the value of the edit box:
Code:
void bessk0(double *x,double *k0,int nSize);
void bessk1(double *x,double *k1, int nSize);
void ei(double *x, double *expi, int nSize);
void unbound(double *unbd, int nSize)
{
enum{nSize = 100};
double A[nSize],B[nSize],k0[nSize],k1[nSize],s[nSize],expi[nSize],a[nSize],b[nSize];
double x=0;
s[0] = 1;
a[0] = x*sqrt(s[0]);
b[0] = 2*sqrt(s[0]);
bessk0(a,k0,nSize);
bessk1(a,k1,nSize);
ei(b,expi,nSize);
A[0] = k0[0]/(x*sqrt(s[0])*k1[0]);
B[0] = (1-exp(-2*sqrt(s[0])))/(2*sqrt(s[0]));
unbd[0]=0.5*(A[0]-B[0]-expi[0]);
//double CKuchukDlg::getrw(double x);
//x = getrw(x);
CKuchukDlg MyClass;
MyClass.getrw(x);
x = MyClass.getrw(x);
//trial: K0(x) --> x = rw*sqrt(s), as per A-32
for (int t=1;t<nSize;t++)
{
s[t] = 2*t*PI;
a[t] = x*sqrt(s[t]);
b[t] = 2*sqrt(s[t]);
bessk0(a,k0,nSize);
bessk1(a,k1,nSize);
ei(b,expi,nSize);
A[t] = k0[t]/(x*sqrt(s[t])*k1[t]);
B[t] = (1-exp(-2*sqrt(s[t])))/(2*sqrt(s[t]));
unbd[t]=0.5*(A[t]-B[t]-expi[t]);
}
}
While the code compiles without error, i still obtain a debug assertion failure in wincore.cpp!!
Is there a better way of calling my getrw(double x) in my math fxn without having this problem?
Thank you.