From: ColinG on
Hi,

I have successfully compiled a static library: CSG.LIB (uses ATL) via VC6. I
include the header: CSG.h of CSG.LIB into StdAfx.h of a workspace:
CSGTEST.dsw (uses MFC). When I compile CSGTEST.dsw, I receive the following
errors:

c:\wtl71\include\atlprint.h(871) : error C2664: 'int __thiscall
CDC::SelectClipRgn(class CRgn *)' : cannot convert parameter 1 from 'class
WTL::CRgnT<1>' to 'class CRgn *'
No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called
c:\wtl71\include\atlprint.h(854) : while compiling class-template
member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
WTL::CPrintPreviewWindow,class ATL::CWindow,class
ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
igned int,long,int &)'
c:\wtl71\include\atlprint.h(872) : error C2664: 'FillRect' : cannot convert
parameter 2 from 'const int' to 'class CBrush *'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast
c:\wtl71\include\atlprint.h(854) : while compiling class-template
member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
WTL::CPrintPreviewWindow,class ATL::CWindow,class
ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
igned int,long,int &)'
c:\wtl71\include\atlprint.h(874) : error C2664: 'FillRect' : cannot convert
parameter 2 from 'struct HBRUSH__ *' to 'class CBrush *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
c:\wtl71\include\atlprint.h(854) : while compiling class-template
member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
WTL::CPrintPreviewWindow,class ATL::CWindow,class
ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
igned int,long,int &)'

The content of the VC6 ATL static library header: CSG.h is as follows:

// *** Start of CSG.h ***

#pragma once

#ifdef WS_EX_LAYERED
#undef WS_EX_LAYERED
#endif
#define WS_EX_LAYERED 0x00080000

#ifdef LWA_ALPHA
#undef LWA_ALPHA
#endif
#define LWA_ALPHA 0x00000002

#include <atlbase.h>
#include <atlapp.h>
extern CAppModule _Module;
#include <atlwin.h>
#include <atlmisc.h>
#include <atlctrls.h>
#include <atlframe.h>
#include <atldlgs.h>
#include <atlprint.h>
#include <atlctrlx.h>

#include <TCHAR.h>

#include <vector>
#include <deque>
#include <map>
#include <algorithm>
#include <string>
#include <fstream>
using namespace std;

#define EMPTY_STRING _T("")

#define MAX_STRING_LEN 24

// Colorref's used in the program
#define PINK RGB(255,204,204)
#define GREEN RGB(204,255,204)
#define BLUE RGB(153,204,255)
#define YELLOW RGB(255,255,204)
#define WHITE RGB(255,255,255)
#define BLACK RGB( 0, 0, 0)
#define GREY RGB(125,125,125)

// *** End of CSG.h ***

The content of StdAfx.h of a VC6 MFC workspace: CSGTEST.dsw is as follows:

// *** Start of StdAfx.h ***

#if !defined(AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_)
#define AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#pragma comment(lib, "OLEAUT32")

#define WINVER 0x0400
#define _WIN32_IE 0x0400
#define _WIN32_WINNT 0x0400

#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common
Controls
#include <Winsock2.h>

#include <gdiplus.h>

#include <atlbase.h>

using namespace Gdiplus;

#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

#pragma warning(disable:4786)

#include "UGExcel.h"
#include "ExcelTopHdg.h"
#include "ExcelSideHdg.h"
#include "WorkBookData.h"
#include "DataGridDoc.h"
#include "MainFrm.h"
#include "DataGridView.h"

#include "LicenseInfoDlg.h"

extern CWorkBookData g_workBookData;

extern CLicenseInfoDlg g_licenseInfoDlg;

WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(HIMAGELIST himl, LPSTREAM
pstm);

#include <commctrl.h>

#include <Winspool.h>

#include "CSG.h"

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately
before the previous line.

#endif //
!defined(AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_)

// *** End of StdAfx.h ***

Any assistance would be much appreciated.

Many thanks.

Colin


From: aao on
template errors are difficult to diagnose without source code. It would be
helpful if you publish at least parts of you code here. It seems that you
program mixes MFC and WTL - but it is only a guess.
"ColinG" <csg(a)mine.com> wrote in message
news:ejh0vhagHHA.4900(a)TK2MSFTNGP05.phx.gbl...
> Hi,
>
> I have successfully compiled a static library: CSG.LIB (uses ATL) via VC6.
> I
> include the header: CSG.h of CSG.LIB into StdAfx.h of a workspace:
> CSGTEST.dsw (uses MFC). When I compile CSGTEST.dsw, I receive the
> following
> errors:
>
> c:\wtl71\include\atlprint.h(871) : error C2664: 'int __thiscall
> CDC::SelectClipRgn(class CRgn *)' : cannot convert parameter 1 from 'class
> WTL::CRgnT<1>' to 'class CRgn *'
> No user-defined-conversion operator available that can perform this
> conversion, or the operator cannot be called
> c:\wtl71\include\atlprint.h(854) : while compiling class-template
> member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
> WTL::CPrintPreviewWindow,class ATL::CWindow,class
> ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
> igned int,long,int &)'
> c:\wtl71\include\atlprint.h(872) : error C2664: 'FillRect' : cannot
> convert parameter 2 from 'const int' to 'class CBrush *'
> Conversion from integral type to pointer type requires
> reinterpret_cast, C-style cast or function-style cast
> c:\wtl71\include\atlprint.h(854) : while compiling class-template
> member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
> WTL::CPrintPreviewWindow,class ATL::CWindow,class
> ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
> igned int,long,int &)'
> c:\wtl71\include\atlprint.h(874) : error C2664: 'FillRect' : cannot
> convert parameter 2 from 'struct HBRUSH__ *' to 'class CBrush *'
> Types pointed to are unrelated; conversion requires
> reinterpret_cast, C-style cast or function-style cast
> c:\wtl71\include\atlprint.h(854) : while compiling class-template
> member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
> WTL::CPrintPreviewWindow,class ATL::CWindow,class
> ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
> igned int,long,int &)'
>
> The content of the VC6 ATL static library header: CSG.h is as follows:
>
> // *** Start of CSG.h ***
>
> #pragma once
>
> #ifdef WS_EX_LAYERED
> #undef WS_EX_LAYERED
> #endif
> #define WS_EX_LAYERED 0x00080000
>
> #ifdef LWA_ALPHA
> #undef LWA_ALPHA
> #endif
> #define LWA_ALPHA 0x00000002
>
> #include <atlbase.h>
> #include <atlapp.h>
> extern CAppModule _Module;
> #include <atlwin.h>
> #include <atlmisc.h>
> #include <atlctrls.h>
> #include <atlframe.h>
> #include <atldlgs.h>
> #include <atlprint.h>
> #include <atlctrlx.h>
>
> #include <TCHAR.h>
>
> #include <vector>
> #include <deque>
> #include <map>
> #include <algorithm>
> #include <string>
> #include <fstream>
> using namespace std;
>
> #define EMPTY_STRING _T("")
>
> #define MAX_STRING_LEN 24
>
> // Colorref's used in the program
> #define PINK RGB(255,204,204)
> #define GREEN RGB(204,255,204)
> #define BLUE RGB(153,204,255)
> #define YELLOW RGB(255,255,204)
> #define WHITE RGB(255,255,255)
> #define BLACK RGB( 0, 0, 0)
> #define GREY RGB(125,125,125)
>
> // *** End of CSG.h ***
>
> The content of StdAfx.h of a VC6 MFC workspace: CSGTEST.dsw is as follows:
>
> // *** Start of StdAfx.h ***
>
> #if
> !defined(AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_)
> #define AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_
>
> #if _MSC_VER > 1000
> #pragma once
> #endif // _MSC_VER > 1000
>
> #pragma comment(lib, "OLEAUT32")
>
> #define WINVER 0x0400
> #define _WIN32_IE 0x0400
> #define _WIN32_WINNT 0x0400
>
> #include <afxwin.h> // MFC core and standard components
> #include <afxext.h> // MFC extensions
> #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common
> Controls
> #include <Winsock2.h>
>
> #include <gdiplus.h>
>
> #include <atlbase.h>
>
> using namespace Gdiplus;
>
> #ifndef _AFX_NO_AFXCMN_SUPPORT
> #include <afxcmn.h> // MFC support for Windows Common Controls
> #endif // _AFX_NO_AFXCMN_SUPPORT
>
> #pragma warning(disable:4786)
>
> #include "UGExcel.h"
> #include "ExcelTopHdg.h"
> #include "ExcelSideHdg.h"
> #include "WorkBookData.h"
> #include "DataGridDoc.h"
> #include "MainFrm.h"
> #include "DataGridView.h"
>
> #include "LicenseInfoDlg.h"
>
> extern CWorkBookData g_workBookData;
>
> extern CLicenseInfoDlg g_licenseInfoDlg;
>
> WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
> WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(HIMAGELIST himl, LPSTREAM
> pstm);
>
> #include <commctrl.h>
>
> #include <Winspool.h>
>
> #include "CSG.h"
>
> //{{AFX_INSERT_LOCATION}}
> // Microsoft Visual C++ will insert additional declarations immediately
> before the previous line.
>
> #endif //
> !defined(AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_)
>
> // *** End of StdAfx.h ***
>
> Any assistance would be much appreciated.
>
> Many thanks.
>
> Colin
>
>


From: ColinG on
Hi,

Thanks for your reply.

I included content of CSG.h for CSG.LIB and StdAfx.h for CSGTEST.dsw in my
original posting. I do not understand what other code you require.

Thanks.

Colin

"aao" <aao(a)work.com> wrote in message
news:%23xr1scbgHHA.4064(a)TK2MSFTNGP02.phx.gbl...
> template errors are difficult to diagnose without source code. It would be
> helpful if you publish at least parts of you code here. It seems that you
> program mixes MFC and WTL - but it is only a guess.
> "ColinG" <csg(a)mine.com> wrote in message
> news:ejh0vhagHHA.4900(a)TK2MSFTNGP05.phx.gbl...
>> Hi,
>>
>> I have successfully compiled a static library: CSG.LIB (uses ATL) via
>> VC6. I
>> include the header: CSG.h of CSG.LIB into StdAfx.h of a workspace:
>> CSGTEST.dsw (uses MFC). When I compile CSGTEST.dsw, I receive the
>> following
>> errors:
>>
>> c:\wtl71\include\atlprint.h(871) : error C2664: 'int __thiscall
>> CDC::SelectClipRgn(class CRgn *)' : cannot convert parameter 1 from
>> 'class WTL::CRgnT<1>' to 'class CRgn *'
>> No user-defined-conversion operator available that can perform
>> this conversion, or the operator cannot be called
>> c:\wtl71\include\atlprint.h(854) : while compiling class-template
>> member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
>> WTL::CPrintPreviewWindow,class ATL::CWindow,class
>> ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
>> igned int,long,int &)'
>> c:\wtl71\include\atlprint.h(872) : error C2664: 'FillRect' : cannot
>> convert parameter 2 from 'const int' to 'class CBrush *'
>> Conversion from integral type to pointer type requires
>> reinterpret_cast, C-style cast or function-style cast
>> c:\wtl71\include\atlprint.h(854) : while compiling class-template
>> member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
>> WTL::CPrintPreviewWindow,class ATL::CWindow,class
>> ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
>> igned int,long,int &)'
>> c:\wtl71\include\atlprint.h(874) : error C2664: 'FillRect' : cannot
>> convert parameter 2 from 'struct HBRUSH__ *' to 'class CBrush *'
>> Types pointed to are unrelated; conversion requires
>> reinterpret_cast, C-style cast or function-style cast
>> c:\wtl71\include\atlprint.h(854) : while compiling class-template
>> member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
>> WTL::CPrintPreviewWindow,class ATL::CWindow,class
>> ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
>> igned int,long,int &)'
>>
>> The content of the VC6 ATL static library header: CSG.h is as follows:
>>
>> // *** Start of CSG.h ***
>>
>> #pragma once
>>
>> #ifdef WS_EX_LAYERED
>> #undef WS_EX_LAYERED
>> #endif
>> #define WS_EX_LAYERED 0x00080000
>>
>> #ifdef LWA_ALPHA
>> #undef LWA_ALPHA
>> #endif
>> #define LWA_ALPHA 0x00000002
>>
>> #include <atlbase.h>
>> #include <atlapp.h>
>> extern CAppModule _Module;
>> #include <atlwin.h>
>> #include <atlmisc.h>
>> #include <atlctrls.h>
>> #include <atlframe.h>
>> #include <atldlgs.h>
>> #include <atlprint.h>
>> #include <atlctrlx.h>
>>
>> #include <TCHAR.h>
>>
>> #include <vector>
>> #include <deque>
>> #include <map>
>> #include <algorithm>
>> #include <string>
>> #include <fstream>
>> using namespace std;
>>
>> #define EMPTY_STRING _T("")
>>
>> #define MAX_STRING_LEN 24
>>
>> // Colorref's used in the program
>> #define PINK RGB(255,204,204)
>> #define GREEN RGB(204,255,204)
>> #define BLUE RGB(153,204,255)
>> #define YELLOW RGB(255,255,204)
>> #define WHITE RGB(255,255,255)
>> #define BLACK RGB( 0, 0, 0)
>> #define GREY RGB(125,125,125)
>>
>> // *** End of CSG.h ***
>>
>> The content of StdAfx.h of a VC6 MFC workspace: CSGTEST.dsw is as
>> follows:
>>
>> // *** Start of StdAfx.h ***
>>
>> #if
>> !defined(AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_)
>> #define AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_
>>
>> #if _MSC_VER > 1000
>> #pragma once
>> #endif // _MSC_VER > 1000
>>
>> #pragma comment(lib, "OLEAUT32")
>>
>> #define WINVER 0x0400
>> #define _WIN32_IE 0x0400
>> #define _WIN32_WINNT 0x0400
>>
>> #include <afxwin.h> // MFC core and standard components
>> #include <afxext.h> // MFC extensions
>> #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common
>> Controls
>> #include <Winsock2.h>
>>
>> #include <gdiplus.h>
>>
>> #include <atlbase.h>
>>
>> using namespace Gdiplus;
>>
>> #ifndef _AFX_NO_AFXCMN_SUPPORT
>> #include <afxcmn.h> // MFC support for Windows Common Controls
>> #endif // _AFX_NO_AFXCMN_SUPPORT
>>
>> #pragma warning(disable:4786)
>>
>> #include "UGExcel.h"
>> #include "ExcelTopHdg.h"
>> #include "ExcelSideHdg.h"
>> #include "WorkBookData.h"
>> #include "DataGridDoc.h"
>> #include "MainFrm.h"
>> #include "DataGridView.h"
>>
>> #include "LicenseInfoDlg.h"
>>
>> extern CWorkBookData g_workBookData;
>>
>> extern CLicenseInfoDlg g_licenseInfoDlg;
>>
>> WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
>> WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(HIMAGELIST himl,
>> LPSTREAM pstm);
>>
>> #include <commctrl.h>
>>
>> #include <Winspool.h>
>>
>> #include "CSG.h"
>>
>> //{{AFX_INSERT_LOCATION}}
>> // Microsoft Visual C++ will insert additional declarations immediately
>> before the previous line.
>>
>> #endif //
>> !defined(AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_)
>>
>> // *** End of StdAfx.h ***
>>
>> Any assistance would be much appreciated.
>>
>> Many thanks.
>>
>> Colin
>>
>>
>
>


From: aao on
Sorry I was not clear - what I mean is that you posted compiler errors for
the cpp file that is not present -post everything from output window here it
might help. BTW what version wtl is that in c:\wtl71\include, it could be
that you compiling with wtl version that is incompatible with VC6

"ColinG" <csg(a)mine.com> wrote in message
news:ea10tfbgHHA.4596(a)TK2MSFTNGP05.phx.gbl...
> Hi,
>
> Thanks for your reply.
>
> I included content of CSG.h for CSG.LIB and StdAfx.h for CSGTEST.dsw in my
> original posting. I do not understand what other code you require.
>
> Thanks.
>
> Colin
>
> "aao" <aao(a)work.com> wrote in message
> news:%23xr1scbgHHA.4064(a)TK2MSFTNGP02.phx.gbl...
>> template errors are difficult to diagnose without source code. It would
>> be helpful if you publish at least parts of you code here. It seems that
>> you program mixes MFC and WTL - but it is only a guess.
>> "ColinG" <csg(a)mine.com> wrote in message
>> news:ejh0vhagHHA.4900(a)TK2MSFTNGP05.phx.gbl...
>>> Hi,
>>>
>>> I have successfully compiled a static library: CSG.LIB (uses ATL) via
>>> VC6. I
>>> include the header: CSG.h of CSG.LIB into StdAfx.h of a workspace:
>>> CSGTEST.dsw (uses MFC). When I compile CSGTEST.dsw, I receive the
>>> following
>>> errors:
>>>
>>> c:\wtl71\include\atlprint.h(871) : error C2664: 'int __thiscall
>>> CDC::SelectClipRgn(class CRgn *)' : cannot convert parameter 1 from
>>> 'class WTL::CRgnT<1>' to 'class CRgn *'
>>> No user-defined-conversion operator available that can perform
>>> this conversion, or the operator cannot be called
>>> c:\wtl71\include\atlprint.h(854) : while compiling class-template
>>> member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
>>> WTL::CPrintPreviewWindow,class ATL::CWindow,class
>>> ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
>>> igned int,long,int &)'
>>> c:\wtl71\include\atlprint.h(872) : error C2664: 'FillRect' : cannot
>>> convert parameter 2 from 'const int' to 'class CBrush *'
>>> Conversion from integral type to pointer type requires
>>> reinterpret_cast, C-style cast or function-style cast
>>> c:\wtl71\include\atlprint.h(854) : while compiling class-template
>>> member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
>>> WTL::CPrintPreviewWindow,class ATL::CWindow,class
>>> ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
>>> igned int,long,int &)'
>>> c:\wtl71\include\atlprint.h(874) : error C2664: 'FillRect' : cannot
>>> convert parameter 2 from 'struct HBRUSH__ *' to 'class CBrush *'
>>> Types pointed to are unrelated; conversion requires
>>> reinterpret_cast, C-style cast or function-style cast
>>> c:\wtl71\include\atlprint.h(854) : while compiling class-template
>>> member function 'long __thiscall WTL::CPrintPreviewWindowImpl<class
>>> WTL::CPrintPreviewWindow,class ATL::CWindow,class
>>> ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned int,uns
>>> igned int,long,int &)'
>>>
>>> The content of the VC6 ATL static library header: CSG.h is as follows:
>>>
>>> // *** Start of CSG.h ***
>>>
>>> #pragma once
>>>
>>> #ifdef WS_EX_LAYERED
>>> #undef WS_EX_LAYERED
>>> #endif
>>> #define WS_EX_LAYERED 0x00080000
>>>
>>> #ifdef LWA_ALPHA
>>> #undef LWA_ALPHA
>>> #endif
>>> #define LWA_ALPHA 0x00000002
>>>
>>> #include <atlbase.h>
>>> #include <atlapp.h>
>>> extern CAppModule _Module;
>>> #include <atlwin.h>
>>> #include <atlmisc.h>
>>> #include <atlctrls.h>
>>> #include <atlframe.h>
>>> #include <atldlgs.h>
>>> #include <atlprint.h>
>>> #include <atlctrlx.h>
>>>
>>> #include <TCHAR.h>
>>>
>>> #include <vector>
>>> #include <deque>
>>> #include <map>
>>> #include <algorithm>
>>> #include <string>
>>> #include <fstream>
>>> using namespace std;
>>>
>>> #define EMPTY_STRING _T("")
>>>
>>> #define MAX_STRING_LEN 24
>>>
>>> // Colorref's used in the program
>>> #define PINK RGB(255,204,204)
>>> #define GREEN RGB(204,255,204)
>>> #define BLUE RGB(153,204,255)
>>> #define YELLOW RGB(255,255,204)
>>> #define WHITE RGB(255,255,255)
>>> #define BLACK RGB( 0, 0, 0)
>>> #define GREY RGB(125,125,125)
>>>
>>> // *** End of CSG.h ***
>>>
>>> The content of StdAfx.h of a VC6 MFC workspace: CSGTEST.dsw is as
>>> follows:
>>>
>>> // *** Start of StdAfx.h ***
>>>
>>> #if
>>> !defined(AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_)
>>> #define AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_
>>>
>>> #if _MSC_VER > 1000
>>> #pragma once
>>> #endif // _MSC_VER > 1000
>>>
>>> #pragma comment(lib, "OLEAUT32")
>>>
>>> #define WINVER 0x0400
>>> #define _WIN32_IE 0x0400
>>> #define _WIN32_WINNT 0x0400
>>>
>>> #include <afxwin.h> // MFC core and standard components
>>> #include <afxext.h> // MFC extensions
>>> #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common
>>> Controls
>>> #include <Winsock2.h>
>>>
>>> #include <gdiplus.h>
>>>
>>> #include <atlbase.h>
>>>
>>> using namespace Gdiplus;
>>>
>>> #ifndef _AFX_NO_AFXCMN_SUPPORT
>>> #include <afxcmn.h> // MFC support for Windows Common Controls
>>> #endif // _AFX_NO_AFXCMN_SUPPORT
>>>
>>> #pragma warning(disable:4786)
>>>
>>> #include "UGExcel.h"
>>> #include "ExcelTopHdg.h"
>>> #include "ExcelSideHdg.h"
>>> #include "WorkBookData.h"
>>> #include "DataGridDoc.h"
>>> #include "MainFrm.h"
>>> #include "DataGridView.h"
>>>
>>> #include "LicenseInfoDlg.h"
>>>
>>> extern CWorkBookData g_workBookData;
>>>
>>> extern CLicenseInfoDlg g_licenseInfoDlg;
>>>
>>> WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
>>> WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(HIMAGELIST himl,
>>> LPSTREAM pstm);
>>>
>>> #include <commctrl.h>
>>>
>>> #include <Winspool.h>
>>>
>>> #include "CSG.h"
>>>
>>> //{{AFX_INSERT_LOCATION}}
>>> // Microsoft Visual C++ will insert additional declarations immediately
>>> before the previous line.
>>>
>>> #endif //
>>> !defined(AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_)
>>>
>>> // *** End of StdAfx.h ***
>>>
>>> Any assistance would be much appreciated.
>>>
>>> Many thanks.
>>>
>>> Colin
>>>
>>>
>>
>>
>
>


From: ColinG on
But the errors refer to c:\wtl71\include\atlprint.h. I do not have access to
the cpp file for atlprint. If you are refering to cpp files in CSG.LIB or
CSGTEST.dsw then the question would be which ones.
To post all of them would be a bad idea, IMO.

Which cpp file specifically are you referring to?

Thanks.

Colin

"aao" <aao(a)work.com> wrote in message
news:u6UTKobgHHA.4980(a)TK2MSFTNGP02.phx.gbl...
> Sorry I was not clear - what I mean is that you posted compiler errors for
> the cpp file that is not present -post everything from output window here
> it might help. BTW what version wtl is that in c:\wtl71\include, it could
> be that you compiling with wtl version that is incompatible with VC6
>
> "ColinG" <csg(a)mine.com> wrote in message
> news:ea10tfbgHHA.4596(a)TK2MSFTNGP05.phx.gbl...
>> Hi,
>>
>> Thanks for your reply.
>>
>> I included content of CSG.h for CSG.LIB and StdAfx.h for CSGTEST.dsw in
>> my original posting. I do not understand what other code you require.
>>
>> Thanks.
>>
>> Colin
>>
>> "aao" <aao(a)work.com> wrote in message
>> news:%23xr1scbgHHA.4064(a)TK2MSFTNGP02.phx.gbl...
>>> template errors are difficult to diagnose without source code. It would
>>> be helpful if you publish at least parts of you code here. It seems that
>>> you program mixes MFC and WTL - but it is only a guess.
>>> "ColinG" <csg(a)mine.com> wrote in message
>>> news:ejh0vhagHHA.4900(a)TK2MSFTNGP05.phx.gbl...
>>>> Hi,
>>>>
>>>> I have successfully compiled a static library: CSG.LIB (uses ATL) via
>>>> VC6. I
>>>> include the header: CSG.h of CSG.LIB into StdAfx.h of a workspace:
>>>> CSGTEST.dsw (uses MFC). When I compile CSGTEST.dsw, I receive the
>>>> following
>>>> errors:
>>>>
>>>> c:\wtl71\include\atlprint.h(871) : error C2664: 'int __thiscall
>>>> CDC::SelectClipRgn(class CRgn *)' : cannot convert parameter 1 from
>>>> 'class WTL::CRgnT<1>' to 'class CRgn *'
>>>> No user-defined-conversion operator available that can perform
>>>> this conversion, or the operator cannot be called
>>>> c:\wtl71\include\atlprint.h(854) : while compiling
>>>> class-template member function 'long __thiscall
>>>> WTL::CPrintPreviewWindowImpl<class WTL::CPrintPreviewWindow,class
>>>> ATL::CWindow,class ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned
>>>> int,uns
>>>> igned int,long,int &)'
>>>> c:\wtl71\include\atlprint.h(872) : error C2664: 'FillRect' : cannot
>>>> convert parameter 2 from 'const int' to 'class CBrush *'
>>>> Conversion from integral type to pointer type requires
>>>> reinterpret_cast, C-style cast or function-style cast
>>>> c:\wtl71\include\atlprint.h(854) : while compiling
>>>> class-template member function 'long __thiscall
>>>> WTL::CPrintPreviewWindowImpl<class WTL::CPrintPreviewWindow,class
>>>> ATL::CWindow,class ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned
>>>> int,uns
>>>> igned int,long,int &)'
>>>> c:\wtl71\include\atlprint.h(874) : error C2664: 'FillRect' : cannot
>>>> convert parameter 2 from 'struct HBRUSH__ *' to 'class CBrush *'
>>>> Types pointed to are unrelated; conversion requires
>>>> reinterpret_cast, C-style cast or function-style cast
>>>> c:\wtl71\include\atlprint.h(854) : while compiling
>>>> class-template member function 'long __thiscall
>>>> WTL::CPrintPreviewWindowImpl<class WTL::CPrintPreviewWindow,class
>>>> ATL::CWindow,class ATL::CWinTraits<1442840576,0> >::OnPaint(unsigned
>>>> int,uns
>>>> igned int,long,int &)'
>>>>
>>>> The content of the VC6 ATL static library header: CSG.h is as follows:
>>>>
>>>> // *** Start of CSG.h ***
>>>>
>>>> #pragma once
>>>>
>>>> #ifdef WS_EX_LAYERED
>>>> #undef WS_EX_LAYERED
>>>> #endif
>>>> #define WS_EX_LAYERED 0x00080000
>>>>
>>>> #ifdef LWA_ALPHA
>>>> #undef LWA_ALPHA
>>>> #endif
>>>> #define LWA_ALPHA 0x00000002
>>>>
>>>> #include <atlbase.h>
>>>> #include <atlapp.h>
>>>> extern CAppModule _Module;
>>>> #include <atlwin.h>
>>>> #include <atlmisc.h>
>>>> #include <atlctrls.h>
>>>> #include <atlframe.h>
>>>> #include <atldlgs.h>
>>>> #include <atlprint.h>
>>>> #include <atlctrlx.h>
>>>>
>>>> #include <TCHAR.h>
>>>>
>>>> #include <vector>
>>>> #include <deque>
>>>> #include <map>
>>>> #include <algorithm>
>>>> #include <string>
>>>> #include <fstream>
>>>> using namespace std;
>>>>
>>>> #define EMPTY_STRING _T("")
>>>>
>>>> #define MAX_STRING_LEN 24
>>>>
>>>> // Colorref's used in the program
>>>> #define PINK RGB(255,204,204)
>>>> #define GREEN RGB(204,255,204)
>>>> #define BLUE RGB(153,204,255)
>>>> #define YELLOW RGB(255,255,204)
>>>> #define WHITE RGB(255,255,255)
>>>> #define BLACK RGB( 0, 0, 0)
>>>> #define GREY RGB(125,125,125)
>>>>
>>>> // *** End of CSG.h ***
>>>>
>>>> The content of StdAfx.h of a VC6 MFC workspace: CSGTEST.dsw is as
>>>> follows:
>>>>
>>>> // *** Start of StdAfx.h ***
>>>>
>>>> #if
>>>> !defined(AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_)
>>>> #define AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_
>>>>
>>>> #if _MSC_VER > 1000
>>>> #pragma once
>>>> #endif // _MSC_VER > 1000
>>>>
>>>> #pragma comment(lib, "OLEAUT32")
>>>>
>>>> #define WINVER 0x0400
>>>> #define _WIN32_IE 0x0400
>>>> #define _WIN32_WINNT 0x0400
>>>>
>>>> #include <afxwin.h> // MFC core and standard components
>>>> #include <afxext.h> // MFC extensions
>>>> #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common
>>>> Controls
>>>> #include <Winsock2.h>
>>>>
>>>> #include <gdiplus.h>
>>>>
>>>> #include <atlbase.h>
>>>>
>>>> using namespace Gdiplus;
>>>>
>>>> #ifndef _AFX_NO_AFXCMN_SUPPORT
>>>> #include <afxcmn.h> // MFC support for Windows Common Controls
>>>> #endif // _AFX_NO_AFXCMN_SUPPORT
>>>>
>>>> #pragma warning(disable:4786)
>>>>
>>>> #include "UGExcel.h"
>>>> #include "ExcelTopHdg.h"
>>>> #include "ExcelSideHdg.h"
>>>> #include "WorkBookData.h"
>>>> #include "DataGridDoc.h"
>>>> #include "MainFrm.h"
>>>> #include "DataGridView.h"
>>>>
>>>> #include "LicenseInfoDlg.h"
>>>>
>>>> extern CWorkBookData g_workBookData;
>>>>
>>>> extern CLicenseInfoDlg g_licenseInfoDlg;
>>>>
>>>> WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
>>>> WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(HIMAGELIST himl,
>>>> LPSTREAM pstm);
>>>>
>>>> #include <commctrl.h>
>>>>
>>>> #include <Winspool.h>
>>>>
>>>> #include "CSG.h"
>>>>
>>>> //{{AFX_INSERT_LOCATION}}
>>>> // Microsoft Visual C++ will insert additional declarations immediately
>>>> before the previous line.
>>>>
>>>> #endif //
>>>> !defined(AFX_STDAFX_H__994FC15C_011D_454F_9501_0FB838CF29D3__INCLUDED_)
>>>>
>>>> // *** End of StdAfx.h ***
>>>>
>>>> Any assistance would be much appreciated.
>>>>
>>>> Many thanks.
>>>>
>>>> Colin
>>>>
>>>>
>>>
>>>
>>
>>
>
>