Hi all,

My main application is calling a method of class which is implemented in a dll. I have the possibility to change both and after a bit of googling I was able to sort out my problem. It appears that when I pass a std::wstring by value to the dll I get the assertion, but when I pass it by reference everything works fine. I get the assertion at the moment the dll method returns.

I would like to understand why this is caused.

My understanding is that when I pass a string by value the copy constructor is called to create a local instance in the application heap. When the method returns it tries to delete this local instance but it is not in the dll heap and as such this fails with the assertion.

Can somebody confirm this or explain why this is happening?

thank you,

Jef