views:

48

answers:

1

Hi folks, I heard somewhere that passing of wchar_t across VS2005 and VC6 is quite dangerous. I tried to delete memory which was allocated from VC6 dll from VS2008 exe, and it raised assertion. After referring http://stackoverflow.com/questions/1175330/bad-pointer-or-link-issue-when-creating-wstring-from-vc6-dll, i added one func in VC6 dll which shall be used to delete memory. And it solved my issue.

But is there any difference between internal sturcture of whcar_t between VS2008 and VC6.. Please help..

Rgrds, Jinto

+1  A: 

VC6 didn't have a wchar_t type, to start with. However, on both it's a 16 bits type, so that shouldn't cause major issues. It's likely unrelated to the problems you have with malloc() and free(), which work on raw, untyped memory.

MSalters
I dont think so, Iam able to use wchar_t inside VC6 apps. [MFC AppWizar exe - console]. But as u said no major issues when used with different CRTs.
Jinto