| | | | Browse by category |
Article ID: 1112
Last updated: 02 Feb, 2008
Problem
zApp does not build sucessfully using MSVC 6.0.
Cause
Action
zApp does not build sucessfully using MSVC 6.0.
Cause
zApp build fails with the following error:
D:/spm7_patched/parts/zap0310wsourcesrcdispinfo.cpp(190) :
error C2664: 'EnumFontsA' : cannot convert parameter 3 from
'int (__stdcall *)(void)' to
'int (__stdcall *)(const struct tagLOGFONTA *,const struct tagTEXTMETRICA *,unsigned long, long)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
Action
In the file dispinfo.cpp
in spmpartszap0310wsourcesrc
, change line 186 from:
EnumFonts(hDC, faceName, fp, (LPARAM)p);
to
EnumFonts(hDC, faceName,
(int(__stdcall*)(const tagLOGFONTA*, const tagTEXTMETRICA*, unsigned long, long))fp,
(LPARAM)p);
The entire function should look like:
RWTPtrSlist* zDisplayInfo::getFontList(char *faceName) {
lock();
RWTPtrSlist*p = 0;
if (hDC) {
p = ZNEW RWTPtrSlist;
FARPROC fp = MakeProcInstance((FARPROC)fontGrabber, zAppGetAppVar(app)->instance());
EnumFonts(hDC, faceName,
// Just typecast param 3 to what the compiler wants callback to look like
(int(__stdcall*)(const tagLOGFONTA*, const tagTEXTMETRICA*, unsigned long, long))fp,
(LPARAM)p);
FreeProcInstance(fp);
}
unlock();
return p;
}
Save the file and rebuild the library. It should now build successfully.
IMPORTANT: Using zApp with MSVC 6.0 is not supported by Rogue Wave even if this change is made to the zApp source code.
This article was:
Helpful |
Not helpful
Report an issue
Article ID: 1112
Last updated: 02 Feb, 2008
Revision: 1
Views: 34048
Posted: 08 Oct, 1998 by
Dean J.
Updated: 02 Feb, 2008 by
Dean J.
Others in this category
Powered by KBPublisher (Knowledge base software)