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 ...!!