发表于:2008-12-14 22:23:09
楼主
//参数存盘
#include "apdefap.h"
void OnLButtonDown(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)
{
char info【255】="";
float temp;
FILE *fp;
fp=fopen("C:\\Siemens\\canshusheding\\canshu2","w");
temp=GetTagFloat("ywmodu1011");if(fwrite(&temp,sizeof(float),1,fp)!=1){ strcpy(info,"Write Error");SetOutputValueChar(lpszPictureName,"DisplayXishu",info);return;}
if(fp==NULL)
{
strcpy(info,"Can‘t open file");
SetOutputValueChar(lpszPictureName,"DisplayXishu1",info);
fclose(fp);//文件关闭
return;
}
else
{
strcpy(info,"´存盘完成");
SetOutputValueChar(lpszPictureName,"DisplayXishu1",info);// DisplayXishu1 I/O域的名字
fclose(fp);
}
return;
}