我得到以下原型DLL:C++ DLL返回指针到std ::列表<性病:: wstring的>
DLL_EXPORT std::list<std::wstring>* c_ExplodeWStringToList(std::wstring in_delimiter, std::wstring in_string, int in_limit);
应用程序使用此类似:
std::list<std::wstring>* exploded = mydllclass->c_ExplodeWStringToList(L" ", in_command.c_str(), 0);
该作品伟大在XP 32下,但是当我在家里用我的Vista 64试用这个程序时,我的程序就会关闭。没有错误也没有警告?
几天前,DLL直接返回列表 - 没有指针。但是我切换到了VC++ 2010 Express,并且如果不进行此修改,我无法编译我的DLL。
我在这里没有看到什么?
谢谢:)
更新:
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;
}
牛逼
请显示DLL代码的外观,现在看。 –