Bonsoir à tous,

j'ai une galère sur un problème et j'espère vraiment que quelqu'un pourra m'aider, j'ai suivi ce tuto => http://nico-pyright.developpez.com/t...LwrapperCppCli
pour pouvoir appelé du code non managé depuis du C# hors à chaque fois j'obtiens la même erreur sous visual : "class type redefinition" pour le wrapper CLI, qui correspond au code suivant : ( pour info, le compilo me positione l'erreur à la ligne 31)

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
 
// cliWrapper.h
#pragma once
 
#include "personne.h"
#include <windows.h>
#include <vcclr.h>
 
using namespace System;
 
#pragma comment (lib, "libCppForInterop3.lib")
 
namespace conversion{
	static string convertStringToStlString (String ^ chaine) 
	{
		char * chaineChar;
		pin_ptr<const wchar_t> wch = PtrToStringChars(chaine);
		int taille = (chaine->Length+1) * 2;
		chaineChar = new char[taille];
		int t = WideCharToMultiByte(CP_ACP, 0, wch, taille, NULL, 0, NULL, NULL); 
		WideCharToMultiByte(CP_ACP, 0, wch, taille, chaineChar, t, NULL, NULL); 
		std::string chaineSTL = chaineChar;
		delete chaineChar;
		return chaineSTL;
	}
}
 
namespace cliWrapper {
 
 
	public ref class CliWrapperCPersonne
	{
	private:
		CPersonne * cp;
	public:
		CliWrapperCPersonne(String ^nom, String ^prenom)
		{
			string nomStd = conversion::convertStringToStlString(nom);
			string prenomStd = conversion::convertStringToStlString(prenom);
			cp = CPersonne_New(nomStd, prenomStd);
		}
		~CliWrapperCPersonne()
		{
			CPersonne_Delete(cp);
		}
	protected:
		!CliWrapperCPersonne()
		{
			CPersonne_Delete(cp);
		}
	public:
		System::Void Affiche()
		{
			cp->afficheNomPrenom();
		}
	};
 
 
}
Après plusieurs recherches sur Internet, j'ai trouvé d'autres cas similaire ou il fallait rajouter des

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
#ifndef ...
#define ....
#endif
Et bien même en rajoutant ca j'ai tjrs la même erreur, surtout que je n'en vois pas l'utilité sachant que j'ai déjà mis #pragma once .
Du coup je bloque sévère là-dessus, si une âme charitable peut m'aider, ca ne serait donc pas de refus

Merci d'avance à tous ...!!