动态链接库如下,想改变L6的值
#include "math.h"
#include "iostream.h"
double L6=310;
_declspec(dllexport) bool InvertZhi(double zhi)
{
L6=310+zhi;
return true;
}
_declspec(dllexport) bool Forward(double *q)
{
q[0]=L6;
return true;
}
测试
void CDyCeshiDlg::OnButton1()
{
// TODO: Add your control notification handler code here
UpdateData(true);
double zhi=m_Edit2;
InvertZhi(zhi);
double q[1]={0.0};
Forward(q);
m_Edit=q[0];
UpdateData(false);
}
#include "math.h"
#include "iostream.h"
double L6=310;
_declspec(dllexport) bool InvertZhi(double zhi)
{
L6=310+zhi;
return true;
}
_declspec(dllexport) bool Forward(double *q)
{
q[0]=L6;
return true;
}
测试
void CDyCeshiDlg::OnButton1()
{
// TODO: Add your control notification handler code here
UpdateData(true);
double zhi=m_Edit2;
InvertZhi(zhi);
double q[1]={0.0};
Forward(q);
m_Edit=q[0];
UpdateData(false);
}