I have a C++ dll and my C++ application is consuming it. One of the function of the DLL returns String as out parameter. Meaning I am taking String as a c++ reference and populating it in the function and expecting the populated value to be available to the caller. There is an issue in this implementation where the returned String object becomes void when we unload the DLL.
Debugging done:
We have debugged this issue and have found that whenever “Runtime Library” setting of the DLL project is set to “Multi-threaded Debug (/MTd)” the returned String becomes void if its size is greater than 7. If this setting is “Multi-threaded Debug DLL (/MDd)” then the returned reference remains valid even if we unload the DLL. At this point we are not sure whether the problem is with Microsoft or our implementation.
I take it you don't have a support contract with MS or they aren't responding, which is why you are posting here. In that case, regardless of where the issue is, don't bother waiting for MS to provide a fix.
Why do you need to unload the dll before the program has finished? Since, according to your analysis it only happens in this situation.