using CString in ATL COM
Posted on 2003-10-23
i have implemented a COM object in ATL. the string values are BSTR data types. i have been able to implement CString in DCOM by including the <afxwin.h> and <afxdisp.h> in the StdAfx.h file. i did the same in my COM server and i get an error : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
meanwhile, i have not included any windows.h file.
BSTR is more complex to handle than CString. isn't it possible to use CString in COM. why does it work in my DCOM and fail in my COM. be most grateful to find a way out of this.