Fscanf returns the number of actually read data. An error occurs or EOF is returned at the end.
Char szbuf [512];
Getmodulefilename (null, szbuf, 512 );
* Strrchr (szbuf, '//') = '/0 ';
* Strrchr (szbuf, '//') = '/0 ';
Strcat (szbuf, "// lib // image. lib ");
File * fp = fopen (szbuf, "RT ");
Int nimagetype =-1, t = 0;
While (fscanf (FP, "% d % s", & T, & nimagetype, szbuf) = 3)
{
M_cbimagetype.addstring (szbuf );
}
M_cbimagetype.setcursel (2 );
Function prototype:
DWORD getmodulefilename (
Hmodule,
Lptstr lpfilename,
DWORD nsize
);
Function parameter description:
Hmodule loadsProgramInstance handle. If this parameter is null, the function returns the full path of the current application.
Lpfilename lptstr is the pointer to the memory block where you store the returned name. It is an output parameter.
Nsize DWORD, the maximum value loaded to the buffer lpfilename
* Strrchr (szbuf, '//') returns the value of '//' found, and assigns this value to the following value. Here it is assigned to '/0 ', clear.
Strcat connects szbuf to the value behind it.