Probleme string c#

seb8334 Messages postés 4 Date d'inscription jeudi 7 juillet 2005 Statut Membre Dernière intervention 10 avril 2006 - 10 avril 2006 à 14:12
TheSaib Messages postés 2367 Date d'inscription mardi 17 avril 2001 Statut Membre Dernière intervention 26 décembre 2007 - 10 avril 2006 à 23:57
Bonjour ,

Je n'arrive pas à utiliser le type string en C++

Message d'erreur a la compilation
(sous visula sudio .NET 2003)
Citation:

error c2065 , string undifined identifier


Ca ne marche pas meme quand je fais Code:
std::string


Pouvez vous m'aider ?

merci d'avance

mon code :
Code:

#include "stdafx.h"
#include "Global.asax.h"
#define WIN32_LEAN_AND_MEAN /
#include <windows.h>
#include "SophisWSClass.h"

namespace SophisWS
{
double SophisWSClass::getSpot(int i)
{
std::string t = "toto";
SetCurrentDirectory("D:\\Logiciel\\SophisValueV2.1.0.11\");
HMODULE hDLL = LoadLibrary("D:\\Logiciel\\SophisValueV2.1.0.11\\DLLPrototypeD.dll");

//on declare un pointeur sur la fonction (avec des 2 parametre ici pour multiply)
typedef double (WINAPI * DLL_Function_Spot)(int _Value);
DLL_Function_Spot pfn_Spot;
//on appelle GetProcAddress(hdll,NOM_DE_LA_FONCTION_DANS_FICHIER_.REF);
pfn_Spot= (DLL_Function_Spot)GetProcAddress(hDLL,"GetSpot");

//on appelle la fonction
double res = pfn_Spot(i);

//on libère la DLL
FreeLibrary(hDLL);

return res;
}

void SophisWSClass::loadApi()
{
SetCurrentDirectory("D:\\Logiciel\\SophisValueV2.1.0.11\");
HMODULE hDLL = LoadLibrary("D:\\Logiciel\\SophisValueV2.1.0.11\\DLLPrototypeD.dll");

//on declare un pointeur sur la fonction (avec des 2 parametre ici pour multiply)
typedef double (WINAPI * DLL_Function_Load)();
DLL_Function_Load pfn_Load;

//on appelle GetProcAddress(hdll,NOM_DE_LA_FONCTION_DANS_FICHIER_.REF);
pfn_Load= (DLL_Function_Load)GetProcAddress(hDLL,"LoadAPI");

//on appelle la fonction
pfn_Load();

//on libère la DLL
FreeLibrary(hDLL);
}
};

2 réponses

Nikoui Messages postés 794 Date d'inscription vendredi 24 septembre 2004 Statut Membre Dernière intervention 19 août 2008 13
10 avril 2006 à 14:59
Tu auras surement plus de réponse en posant ta question sur un site dédié au C++ (et non au C#), comme celui-ci par exemple :

http://www.cppfrance.com/
0
TheSaib Messages postés 2367 Date d'inscription mardi 17 avril 2001 Statut Membre Dernière intervention 26 décembre 2007 23
10 avril 2006 à 23:57
#include <string>

::|The S@ib|:: MVP C#.NET
0
Rejoignez-nous