Bonjour,

j'ai un r�el probl�me � lire une fonction contenue dans une DLL. Mon code est pr�sent� ci-dessous. En mode DEBUG, le programme semble voir la DLL et la fonction, car ma variable verification indique 1.

Cependant, lorsque j'arrive � la ligne o� j'appelle ma fonction :

XsatTPtillnerroth4(T,P,&variable_out1,&variable_out2,&variable_out3,&variable_out4,&variable_out5,&variable_out6,&variable_out7,&variable_out8);

j'ai cette erreur : Unhandled exception at 0x0d69ca14 in CC6.exe 0xC0000005 : Access violation reading location 0x41430329.

J'ai l'impression que cela a rapport avec mes pointeurs ... mais je suis assez d�butant en C ++ alors je ne suis pas certain.

Quelqu'un peut m'aider avec ceci ?

Merci

Code : S�lectionner tout - Visualiser dans une fen�tre � part
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
void addk(float *y, float *x, double t, double p, float *xkv)
{	
	//On défini le format de la fonction 1 de Brice à aller chercher
	typedef void(_stdcall* FunctionDLL_1)(double,double,double*,double*,double*,double*,double*,double*,double*,double*);
 
	// On commence par mettre la température et la pression dans les unités de la DLL de Brice
	// Présentement, elles sont dans les unités internes de CHEMCAD (RANKINE et PSIA)
	double T = t*0.5556;
	double P = p*0.0068948;
 
	// On défini le chemin de la DLL
	HINSTANCE DLL_path;
	FunctionDLL_1 XsatTPtillnerroth4;
	DLL_path = LoadLibrary("./propthermo.dll");
	XsatTPtillnerroth4 = (FunctionDLL_1)GetProcAddress(DLL_path,"XsatTPtillnerroth4");
 
 
	double verification;	
 
	if (XsatTPtillnerroth4 != NULL)
	//if (PRESSdll != NULL)
	{
		verification = 1;
	}
	else
	{	
		verification = 0;
	}
 
	//On défini les variables à utiliser dans les fonctions en entrée et sortie
	double variable_out1;
	double variable_out2;
	double variable_out3;
	double variable_out4;
	double variable_out5;
	double variable_out6;
	double variable_out7;
	double variable_out8;
 
	//On appelle alors la fonction en définissant en premier le nom des variables
	XsatTPtillnerroth4(T,P,&variable_out1,&variable_out2,&variable_out3,&variable_out4,&variable_out5,&variable_out6,&variable_out7,&variable_out8);
 
 
	// On libère la dll après sont calcul
	FreeLibrary(DLL_path);
 
}