开发者

FindFirstFile type problems

开发者 https://www.devze.com 2023-02-18 17:18 出处:网络
I\'m writing a function that will check if there\'s a jpg file in the given folder. My try at this is as follows:

I'm writing a function that will check if there's a jpg file in the given folder. My try at this is as follows:

    int containsJpgs(String ^path)
    {
        WIN32_FIND_DATA data;
        HANDLE hFind;
        hFind = FindFirstFile(path + "*.jpg", &data); // Type error.
        if (hFind == INVALID_HANDLE_VALUE) 
        {
            return 0;
        开发者_StackOverflow}
        return 1;
    }

How do I append a System::String ^ to a LPCTSTRto get LPCTSTR? And will the above code work when I do that, or are there other problems?


what about lstrcat()?

EDIT: to convert system::string^ to lpctstr I found this

0

精彩评论

暂无评论...
验证码 换一张
取 消