#ifndef __ACP_OPENFILE_H
#define __ACP_OPENFILE_H
 
/* Code for multi-install and multi-language --- Start --- */
#ifndef U64
  extern char g_cCDROM;
  extern char g_sLanguage[255];
 
/* ANNECY OA - 20/07/99 { */
#ifdef RETAIL
#define ACP_M_OPENFILE(fonction,returnValue,error,filename,paramList)\
{\
	char szTemp[255];\
	returnValue = ##fonction####paramList##;\
	if (returnValue == error)\
	{\
		strcpy( szTemp, filename);\
		sprintf(filename,"%c:\\%s",g_cCDROM,szTemp);\
		returnValue = ##fonction####paramList##;\
		while (returnValue == error)\
		{\
			if (MessageBox(NULL, "Inserez le CD dans le lecteur", "CDROM non trouvé!", MB_RETRYCANCEL) == IDCANCEL)\
			{\
				abort(0);\
			}\
 			returnValue = ##fonction####paramList##;\
		}\
		strcpy(filename,szTemp);\
	}\
}
#else
#define ACP_M_OPENFILE(fonction,returnValue,error,filename,paramList)\
{\
	char szTemp[255];\
	returnValue = ##fonction####paramList##;\
	if (returnValue == error)\
	{\
		strcpy( szTemp, filename);\
		sprintf(filename,"%c:\\%s",g_cCDROM,szTemp);\
		returnValue = ##fonction####paramList##;\
		strcpy(filename,szTemp);\
	}\
}
#endif
/* END ANNECY OA } */
 
#define ACP_M_OPENLANGFILE(fonction,returnValue,error,pathFileName,paramList)\
{\
    char szTemp[255];\
    char szPath[255];\
	char *p_cFileName;\
	returnValue = ##fonction####paramList##;\
	if (returnValue == error)\
	{\
	  strcpy( szTemp, pathFileName);\
	  p_cFileName = strrchr( szTemp, '\\' );\
	  strncpy( szPath, szTemp, p_cFileName - szTemp + 1);\
	  szPath[p_cFileName - szTemp + 1] = '\0';\
	  sprintf(pathFileName,"%c:\\%s%s%s",g_cCDROM,szPath,g_sLanguage,p_cFileName);\
	  returnValue = ##fonction####paramList##;\
	  strcpy(pathFileName,szTemp);\
	}\
}
 
#else
 
#define ACP_M_OPENFILE(fonction,returnValue,error,filename,paramList)\
{\
	returnValue = ##fonction##paramList;\
}
 
#define ACP_M_OPENLANGFILE(fonction,returnValue,error,filename,paramList)\
{\
	returnValue = ##fonction##paramList;\
}
#endif /* U64*/
/* Code for multi-install and multi-language --- Stop --- */
 
 
#endif /* __ACP_OPENFILE_H */
