Ajout un fichier .cpp dans un projet [vc++6]

dulac02 Messages postés 15 Date d'inscription jeudi 19 décembre 2002 Statut Membre Dernière intervention 16 août 2004 - 5 juil. 2004 à 23:44
BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019 - 6 juil. 2004 à 00:31
Salut a tous
je galère sous vc++6 :
j'ai crée un fichier FichierIni.cpp dans lequel j'ai mis le code suivant :

#include "FichierIni.h"

void Lire_Ini ( LPCTSTR Section,LPCTSTR Cle,char *chaine, LPCTSTR Fichier)
{
char temporaire[100];
GetPrivateProfileString(Section,Cle, "", temporaire, sizeof(temporaire),Fichier);
strcpy (chaine,temporaire);
}

void Ecrire_Ini ( LPCTSTR Section,LPCTSTR Cle, LPCTSTR chaine, LPCTSTR Fichier)
{
WritePrivateProfileString( Section, Cle, chaine, Fichier);
}

Puis j'ai crée un fichier FichierIni.h avec le code :

#pragma once

void Lire_Ini ( LPCTSTR Section,LPCTSTR Cle,char *chaine, LPCTSTR Fichier);
void Ecrire_Ini ( LPCTSTR Section,LPCTSTR Cle, LPCTSTR chaine, LPCTSTR Fichier);

Dans le fichier main.cpp, j'ai rajouté la ligne #include "FichierIni.h"

Le compilateur m'indique une série d'erreurs du style 'LPCTSTR' : undeclared identifier, etc
et quand je place le code contenu dans FichierIni.cpp en supprimanrt le fichier .h
dans main.cpp tout va bien

Qq'un peut me dire pourquoi ? (ça doit être très compliqué :-)
merci

1 réponse

BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019
6 juil. 2004 à 00:31
#include <windows.h>
en haut du fichier

ciao...
BruNews, Admin CS, MVP Visual C++
0
Rejoignez-nous