Thanks!
I have already looked over these extensively and still cant figure it out.
I have got the write to file working with the following function:
Code:
int SaveBat (HWND hwndDlg)
{
// took me 3 hours to get this working!!
FILE *fptr;
char mytexta[1024];
fptr = fopen("sample1.bat", "w");
GetDlgItemText(hwndDlg, IDEDIT1, mytexta, 1023);
fprintf(fptr,"%s",mytexta);
fclose(fptr);
return TRUE;
}
but I cant seem to reverse this to read the file contents into the field.
I've tried the following, but it only shows the first line using fgets. Again I have tried examples of while statements to read all lines, but can't get them to work
Code:
int LoadBat (HWND hwndDlg)
{
FILE *fptrc;
char mytextc[1024];
fptrc = fopen("sample1.bat", "r");
fgets( mytextc, 1023, fptrc );
SetDlgItemText(hwndDlg, IDEDIT1, mytextc);
fclose( fptrc );
return TRUE;
}
If anyone can show me how to make this work, or show me how to make the WinAPI method work I would be most grateful.
Thanks again!