MyException - 我的异常网
当前位置:我的异常网» VC/MFC » 上面四个异常如何更改

上面四个异常如何更改

www.MyException.Cn  网友分享于:2013-02-20  浏览:27次
下面四个错误怎么更改?

error C2664: “FindFirstFileW”: 不能将参数 1 从“LPSTR”转换为“LPCWSTR”
       与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
error C2664: “strcmp”: 不能将参数 1 从“WCHAR [260]”转换为“const char *”
       与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
error C2664: “strcmp”: 不能将参数 1 从“WCHAR [260]”转换为“const char *”
error C2664: “strcat”: 不能将参数 2 从“WCHAR [260]”转换为“const char *”
      与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换







#include "stdafx.h"
#include "Windows.h"
#include "stdio.h"

void Find(LPSTR path){
        WIN32_FIND_DATA fs={0};

        CHAR buf[512]={0};
        strcpy(buf,path);

        strcat(path,"/*.*");

        HANDLE hFind=FindFirstFile(path,&fs);
        BOOL goFind=TRUE;

        while(goFind){
                if(fs.dwFileAttributes==FILE_ATTRIBUTE_ARCHIVE)
                {
                        printf("%s\n",fs.cFileName);
                        Sleep(1000);
                }else{
                        if(strcmp(fs.cFileName,".")&&strcmp(fs.cFileName,"..")){
                                CHAR buff[512]={0};
                                strcat(buff,buf);
                                printf("[%s]\n",fs.cFileName);
                                Sleep(1000);
                                strcat(buff,"/");
                                strcat(buff,fs.cFileName);
                                Find(buff);
                                printf("-----------\n");

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有