|
-
July 21st, 2005, 03:41 AM
#1
std::string going out of scope
i'm sure the whole stl being used in a dll thing has been discussed a lot already, but i always seem to have 1 specific problem, as demonstrated by this code:
Code:
#include "stdafx.h"
#include "MyLibrary.h"
int main(int argc, char* argv[])
{
Node node;
node.x = 900;
node.y = 955;
node.description = "node 1";
return 0;
}
MyLibrary is a dll project, and the MyLibrary header includes this definition od Node:
Code:
class ITINARARYFINDA_API Node {
public:
float x;
float y;
std::string description;
};
the problem is, that there is a debug assertion failed error on expression _CrtIsValidHeapPointer(pUserData) at runtime, when the main function returns. i'm fairly sure it occurs when the std::string goes out of scope, since i've had similar problems before.
am i doing something wrong here?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|