Je suis une dll avec le prototype suivant:C++ DLL pointeur retour à std :: liste <std :: wstring>
DLL_EXPORT std::list<std::wstring>* c_ExplodeWStringToList(std::wstring in_delimiter, std::wstring in_string, int in_limit);
L'application utilise ce genre:
std::list<std::wstring>* exploded = mydllclass->c_ExplodeWStringToList(L" ", in_command.c_str(), 0);
Cela fonctionne super sous XP 32, mais quand j'essaye ça à la maison avec mon Vista 64 mon programme se ferme juste. Pas d'erreur et pas d'avertissement?
Il y a quelques jours, la DLL renvoyait la liste directement - pas de pointeur. Mais je suis passé à VC++ 2010 Express, et je n'ai pas pu compiler ma DLL sans cette modification.
Tout ce que je ne vois pas ici?
Merci :)
Mise à jour:
DLL_EXPORT std::list<std::wstring>* c_ExplodeWStringToList(std::wstring in_delimiter, std::wstring in_string, int in_limit)
{
std::list<std::wstring>* returnlist = new std::list<std::wstring>();
std::list<std::wstring>* stringlist = new std::list<std::wstring>();
UINT pos = 0;
while(true)
{
pos = in_string.find(in_delimiter, 0);
if(pos == std::string::npos)
{
stringlist->push_back(in_string.substr(0, pos));
break;
}
else
{
stringlist->push_back(in_string.substr(0, pos));
in_string = in_string.substr(pos + in_delimiter.length());
}
}
// ****
// Here is missing some code I've commented out while searching for the error.
// ****
returnlist = stringlist;
return returnlist;
}
T
S'il vous plaît montrer comment le code DLL a regardé, et regarde maintenant. –