Bonjour à tous! Bon, mon problème me dépasse un petit peux...
J'ai créer une classe qui me permet de gérer des fichier XML selon mon besoin. Pas de problème de ce côté là. Comme vous allé le voire, j'utilise un TXmlDocument créer dynamiquement pour éditer mes fichier XML.
Voici un partie du code source de ma classe :
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Je n'ai pas écris la totalité du fichier 'TXmlCreator.cpp' par souci de clarté. Si mon code vous intéresse, demandé le moi!
Le problème ce situe au niveau du destructeur.J'ai une violation d'accès mémoire au moment du delete.
J'ai commencé par voir au niveau de la documentation du TXmlDocument, et je suis tombé la dessus :
Citation : Documentation TXmlDocument
Citation : Documentation TXmlDocumentDisposes of a TXMLDocument object.
__fastcall virtual ~TXMLDocument(void);
Description
It is not necessary to explicitly free a TXMLDocument component. If the component is created with an Owner, that Owner handles the task of freeing the document. If the component is created without an Owner, it is freed automatically when the reference count on its IXMLDocument interface drops to zero.
Si je comprend bien, ces paragraphes disent que le TXmlDocument ce fait détruire par son owner si il en possède un (le mien n'en a pas) et que dans le cas où il n'en à pas, il ce détruit lorsque son compteur d'interface arrivais à 0.When TXMLDocument is created without an Owner, it behaves like an interfaced object. That is, when all references to its interface are released, the TXMLDocument instance is automatically freed. When TXMLDocument is created with an Owner, however, it behaves like any other component, and is freed by its Owner. When you add a TXMLDocument component from the component palette to a form or data module, it is automatically created with an Owner. When the TXMLDocument component is created using the global LoadXMLDocument function (or by a function that the XML Data Binding wizard generates to return the root node of the document), the function creates a TXMLDocument instance without an Owner.
Là je me suis dis cool, je n'ai qu'à supprimer l'interface iXML! J'ai trouvé une méthode 'release()' qui appartient à iXml, et qui renvoie le nombre d'interface restante! Le problème c'est que cette méthode me renvoie 1, et non pas 0. Il y a donc encore une interface.
Je suis pas très doué en programmation mais je trouvais que faire comme ceci était un peu 'moyen' :-°
Du coup j'ai cherché sur internet, je suis tombé sur un post intéressant :
http://www.developpez.net/forums/d30.../txmldocument/
Bon, alors là, ça me dépasse COMPLÈTEMENT!
Quelqu'un pourrais me filer un petit coup de main?
Merci à vous!

 

 
		
		 
        

 
			
			


 [TinyXML] Violation d'accès TXmlDocument
 [TinyXML] Violation d'accès TXmlDocument
				 Répondre avec citation
  Répondre avec citation
Partager