|

楼主 |
发表于 2009-5-5 22:24:40
|
显示全部楼层
问题已解决,自己把自己和谐了。。。
int CVICALLBACK Read (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
unsigned char iRequestBytesBig[2000] ="";
FILE *fp;
unsigned long filesize = 0;
unsigned int *array = NULL;
int i = 0;
char c = 0;
switch (event)
{
case EVENT_COMMIT:
GetCtrlVal(panelHandle,PANEL_STRING,g_path_name) ;
fp=fopen(g_path_name,"rb");
if(fp==NULL)
{
return -1;
}
GetFileSize (g_path_name, &filesize);
array = malloc (filesize);
rewind(fp);
for(i = 0; i<filesize; i++)
{
if( !feof(fp))
{
c = fgetc(fp);
iRequestBytesBig[i] = c;
}
}
fclose(fp);
break;
}
return 0;
} |
|