[python-win32] rebuilding 210 with VC8 woes

Alexander Kabanets molotok at online.fr
Wed Jan 31 22:23:00 CET 2007


Howard Lightstone <howard <at> eegsoftware.com> writes:

> 
> While trying to rebuild pywin32 using VC8 (after a couple of distutils 
> patches...), I have reached my C++ limit.  I got all the way to building 
> pythonwin and ...
> 
> I am getting an error as follows:
> 
> d:\python25\pywin32-210\pythonwin\win32uiExt.h(393) : error C2653: 
> 'ThisClass' : is not a class or namespace name
>         d:\python25\pywin32-210\pythonwin\win32uiExt.h(392) : while compiling 
> class template static data member 'const AFX_MSGMAP_ENTRY 
> CPythonWndFramework<T>
> _messageEntries[]'
>         with
>         [
>             T=CFrameWnd
>         ]
>         d:\python25\pywin32-210\pythonwin\win32uiExt.h(387) : while compiling 
> class template static data member 'const AFX_MSGMAP 
> CPythonWndFramework<T>::mess
> eMap'
>         with
>         [
>             T=CFrameWnd
>         ]
>         d:\python25\pywin32-210\pythonwin\pythonframe.h(9) : see reference 
> to class template instantiation 'CPythonWndFramework<T>' being compiled
>         with
>         [
>             T=CFrameWnd
>         ]
> d:\python25\pywin32-210\pythonwin\win32uiExt.h(394) : error C2653: 
> 'ThisClass' : is not a class or namespace name
> 
> ????  I am not sure what this means.....  I *assume* it must be some 
> difference with using VC8 (part of Visual Studio 8) as the compiler.
> 
> I will submit changes for the  minor errors/issues I had to fix to get to 
> this 
> point but they were all scope or explicit cast issues.  I am stumped here.  
> Any 
> help would be appreciated.
> 


Hi,

I've compiled successfully by modifing win32uiExt.h:
1. add before "template <class T> const AFX_MSGMAP_ENTRY 
CPythonWndFramework<T>::_messageEntries[] = {" (line 391)
_________________________________________
#define ThisClass CPythonWndFramework<T>
_________________________________________
and after "{0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 }
};" 
(line 413)
_________________________________________
#undef ThisClass 
_________________________________________
 
2. Change "afx_msg UINT OnNcHitTest(CPoint pt) " by
"afx_msg LRESULT OnNcHitTest(CPoint pt)" (line 293)
 
 
3 . replace the definition of CPythonPrtDlgFramework<T>::_messageEntries
by 
____________________________________________________________________

// I added pointers to the functions
template <class T>
const AFX_MSGMAP_ENTRY CPythonPrtDlgFramework<T>::_messageEntries[] 

= {
        ON_MESSAGE(WM_INITDIALOG,     &HandleInitDialog)
        ON_COMMAND(IDC_PRINT_TO_FILE, &HandlePrintToFile)
        ON_COMMAND(IDC_PRINT_COLLATE, &HandleCollate)
        ON_COMMAND_RANGE(IDC_PRINT_RANGE_ALL, 
IDC_PRINT_RANGE_PAGES, 
&HandlePrintRange)
 {0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 }
};
____________________________________________________________________

It will be placed at line 983.
 
That's all.
 
regards,
 
Alexander Kabanets



More information about the Python-win32 mailing list