I downloaded code about how to encry file by des,the souce code is build by VC6,and i transfer it to VS2010. then it happened some question about fopen function.
bool songDES::Read_Keys(unsigned char * keyfile,bool bIsDES3)
{
FILE * file;
if((file = fopen((const char *)keyfile,"r"))== NULL)
{
printf("file_key open failed!\n");
return false;
}
}
keyfile value equal NcStudiooooo,when run in vc6,fopen can successed,but run in VS2010 it will printf file_key open failed.
i don't know why,please help me to solve this question.
thanks everybody.
the vc6 source code can be downloaded as below,if you want to test in VS2010,you must convert some types or head file. i'm confuse,why in vc6,fopen function can read character but no file path?
[
^]
What I have tried:
In VC6,i key F12 go to definition about fopen,the function declare as below:
_CRTIMP FILE * __cdecl fopen(const char *, const char *);
In Vs2010,i key F12 go to definition about fopen,the function declare as below:
_Check_return_ _CRT_INSECURE_DEPRECATE(fopen_s) _CRTIMP FILE * __cdecl fopen(_In_z_ const char * _Filename, _In_z_ const char * _Mode);
they are all use stdio.h head file,but declare is different,maybe it's important or not.