1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| string __stdcall GetURL() {
FILE* fichierConfig = NULL;
char pURL[TAILLE_MAX] = "";
string ValRetour = "";
fichierConfig = fopen("K8NOMAD.config", "r");
if (fichierConfig != NULL) {
fgets(pURL, TAILLE_MAX, fichierConfig);
if (pURL == "") {
codeErreur = '9';
libelleErreur = "Fichier K8NOMAD.config vide";
modeDeConnexion = 'S';
return ValRetour;
}
} else {
codeErreur = '9';
libelleErreur = "Fichier K8NOMAD.config non trouvé";
modeDeConnexion = 'S';
return ValRetour;
}
ValRetour = *pURL;
return ValRetour;
}
string __stdcall GetTypeConnexion(string PS_szTypeConnexion, string PS_szLibelleErreur) {
HMODULE hDLL = LoadLibrary("Atl.Socle.K8.Connexion.Nomade.dll");
string modeCnx;
string codeErr;
if (hDLL != NULL) {
typedef char (WINAPI *DLL_Function_getTypeConnexion) (string pURL);
DLL_Function_getTypeConnexion pfn_getTypeConnexion;
pfn_getTypeConnexion = (DLL_Function_getTypeConnexion)GetProcAddress(hDLL,"getTypeConnexion");
string pURL = GetURL();
codeErreur=codeErreur;
libelleErreur=libelleErreur;
if (pURL != "") {
modeDeConnexion = pfn_getTypeConnexion(pURL);
} else {
modeDeConnexion = 'S';
}
modeCnx = modeDeConnexion;
codeErr = codeErreur;
FreeLibrary(hDLL);
}
return string(modeCnx) + string(codeErr) + string(libelleErreur);
} |