RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.
↑ Back to the top
The following sample code written�in VC 6.0,�works fine on Win2k3 SP1, but with Win2003 SP2 the blank spaces are being optimized out in release mode.
void main()
{���������������
wstring stringa(L"Hello");
data << setiosflags(ios::left) << setw(15) << stringa;
data << L"END";
��������� wcout << data.str();
��������� getch();
}
↑ Back to the top
Functions like setiosflags & setw are being exposed by MSVCP60.dll and this is the DLL that is being loaded when this code is run. Win 2k3 Sp2 comes with different version of this DLL when compared with Win 2K3 SP1.
↑ Back to the top
This issue can be resolved in two ways
A.�Under RELEASE Project Settings:
1.� Go to C++ Tab
2.�Select Category = �Code Generation�
3.�For �Use Run-Time Library�:�
If you select �Single-Threaded� or �Multi-Threaded� and build, it works fine
B.�Copy MSVCP60.dll of Win 2k3 Sp1 into application release folder and run the application
↑ Back to the top
The advantage of using second method is that the application exe size will be less when compared with first option as it dynamically links with the DLL.
↑ Back to the top