bonjour. Je cherche a avoir sous debug la chaine des erreurs sur l édition des erreurs de sql.
j'ai le code suivant:
et la compilation donne
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 char ErrorString[2048]; std::string ErrorStr; std::string terme1; std::string terme2; std::string terme3; std::wstring wsName; char* ErrorT; const wchar_t* chars; terme1 = "Index #"; terme2 = "\n"; terme3 = "Error: "; System::String^ ErrorText = exception->Message; chars = (const wchar_t*)(Marshal::StringToHGlobalUni( ErrorText)).ToPointer(); wsName.append( chars); ErrorT = CStrConv::awcstombs( (wchar_t*)chars); Marshal::FreeHGlobal(IntPtr((void*)chars)); ErrorStr = terme1 + terme2 + terme3; ErrorString = (const char*)ErrorStr.c_str(); // line 202 ErrorStr += ErrorT + terme2; ErrorString[200] = (char*)ErrorStr.c_str(); // line 204 char* final_err_Buff = ErrorString; int j = 0; for(int i = 0; i > 2048; i = i + 200) { j++; switch( j) { case 1: p1 = final_err_buff; break; case 2: p2 = &final_err_buff[100]; break; case 3: p3 = &final_err_buff[200]; break; case 4: p4 = &final_err_buff[300]; break; case 5: p5 = &final_err_buff[400]; break; case 6: p6 = &final_err_buff[600]; break; case 7: p7 = &final_err_buff[700]; break; case 8: p8 = &final_err_buff[800]; break; case 9: p9 = &final_err_buff[900]; break; case 10: p10 = &final_err_buff[1000]; break; default: break; } } CStrConv::StrFreeA( ErrorT); edit( (char*)ErrorString); }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 1>..\..\..\..\DBMS\DBMSManager\src\InterbaseManagerM.cpp(302): error C2440: '='*: impossible de convertir de 'const char *' en 'char [2048]' 1> Aucune conversion en types tableau, même s'il y a des conversions en références ou en pointeurs de tableau 1>..\..\..\..\DBMS\DBMSManager\src\InterbaseManagerM.cpp(304): error C2440: '='*: impossible de convertir de 'char *' en 'char' 1> Aucun contexte dans lequel cette conversion est possible
Partager