目的:生成一个DLL,用labview调用,实现加法乘除的功能。
1、新建一个工程。
2、添加头文件,头文件里面申明函数和变量。
三个输入,分别是2个参数和一个代表运算法,返回值为double类型。
__declspec(dllexport)表示这个是输出的类型
3、添加cpp函数的内容
#include "stdafx.h"
#include "Dll1.h"
#include <iostream>
using namespace std;
double status(double x, double y,int flag)
{
switch (flag)
{
case 0:return x + y; break;
case 1:return x - y;