Open File

bool OpenFile(const char* pszFileName)
{
#ifdef _EXE_FOR_WIN32_
        m_pFile = fopen(pszFileName, "rb");
#endif
#ifdef _EXE_FOR_PDA_
        const char* filename = pszFileName;
        TCHAR path[256];
        char fullPath[256];
        GetModuleFileName(NULL, path, 256);
        TCHAR *pos = wcsrchr(path, '\\');
        *(pos + 1) = '\0';
        wcstombs(fullPath, path, 256);
        strcat(fullPath, filename);
        m_pFile = fopen(fullPath, "rb");
#endif
        if (!m_pFile)
        {
                return false;
        }

        // other work...

        return true;
}