Click here to Skip to main content
15,903,724 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

When I try to build the QuickWin source (download link: http://www.codeproject.com/KB/dialog/quickwin.aspx) I get some errors. I *have* done it (built it the same way) several years ago using an earlier version of Visual Studio.

Looks like it should be easy to overcome, but I'm not sure how to proceed.
Here's a good example to start with:
c:\projects\quickwin\quickwin\quickwin.h(28) : error C2504: 'CRedirect' : base class undefined

And here's the entire build output (BTW, I am *not* worried about warnings.):
1>------ Build started: Project: QuickWin_Project, Configuration: Debug Win32 ------
1>Compiling...
1>cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
1>QuickTst.cpp
1>c:\projects\quickwin\quicktst\quicktst.cpp(20) : warning C4996: 'gets': This function or variable may be unsafe. Consider using gets_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(279) : see declaration of 'gets'
1>c:\projects\quickwin\quicktst\quicktst.cpp(26) : warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _stricmp. See online help for details.
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\string.h(215) : see declaration of 'stricmp'
1>StdAfx.cpp
1>ChildView.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>c:\projects\quickwin\quickwin\quickwin.h(28) : error C2504: 'CRedirect' : base class undefined
1>c:\projects\quickwin\quickwin\quickwin.h(66) : error C2146: syntax error : missing ';' before identifier 'm_WinPlace'
1>c:\projects\quickwin\quickwin\quickwin.h(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\quickwin\quickwin\quickwin.h(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\quickwin\quickwin\quickview.h(26) : error C2065: 'BUFFER_SIZE' : undeclared identifier
1>c:\projects\quickwin\quickwin\childview.cpp(17) : error C2653: 'CChildView' : is not a class or namespace name
1>c:\projects\quickwin\quickwin\childview.cpp(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\quickwin\quickwin\childview.cpp(19) : warning C4508: 'CChildView' : function should return a value; 'void' return type assumed
1>c:\projects\quickwin\quickwin\childview.cpp(21) : error C2653: 'CChildView' : is not a class or namespace name
1>c:\projects\quickwin\quickwin\childview.cpp(21) : fatal error C1903: unable to recover from previous error(s); stopping compilation
1>LppDlg.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>MainFrm.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>ParamDlg.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>ProcessDlg.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>QuickView.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>c:\projects\quickwin\quickwin\quickview.cpp(74) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
1>QuickWin.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>c:\projects\quickwin\quickwin\quickwin.cpp(45) : warning C4996: '_splitpath': This function or variable may be unsafe. Consider using _splitpath_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdlib.h(786) : see declaration of '_splitpath'
1>c:\projects\quickwin\quickwin\quickwin.cpp(63) : warning C4996: '_splitpath': This function or variable may be unsafe. Consider using _splitpath_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdlib.h(786) : see declaration of '_splitpath'
1>c:\projects\quickwin\quickwin\quickwin.cpp(116) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
1>c:\projects\quickwin\quickwin\quickwin.cpp(118) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
1>c:\projects\quickwin\quickwin\quickwin.cpp(120) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
1>c:\projects\quickwin\quickwin\quickwin.cpp(124) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
1>c:\projects\quickwin\quickwin\quickwin.cpp(159) : warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
1>c:\projects\quickwin\quickwin\quickwin.cpp(195) : error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall CQuickWinApp::* )(WPARAM,LPARAM)' to 'void (__thiscall CWinThread::* )(WPARAM,LPARAM)'
1> None of the functions with this name in scope match the target type
1>Redirect.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>c:\projects\quickwin\quickwin\redirect.cpp(110) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
1>c:\projects\quickwin\quickwin\redirect.cpp(395) : warning C4267: 'initializing' : conversion from 'size_t' to 'DWORD', possible loss of data
1>ToolBar.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>c:\projects\quickwin\quickwin\toolbar.cpp(95) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
1>WinPlace.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>Generating Code...
1>Build log was saved at "file://c:\Projects\QuickWin\Debug\BuildLog.htm"
1>QuickWin_Project - 10 error(s), 15 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any ideas are appreciated.

Matt
Posted

I would suggest that you change the code - the old formatting, string and memory functions has been replaced with safer versions that tries to protect you from buffer overruns. The alternative is to #define _CRT_SECURE_NO_WARNINGS=1 at the project level.

It seems that you need to define WINVER - perhaps #define WINVER 0x0601

As for the CRedirect, you need to dig into the code, perhaps another missing define prevents it from being included.

Best regards
Espen Harlinn
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 27-Oct-11 21:30pm    
My 5.
--SA
Espen Harlinn 28-Oct-11 6:39am    
Thank you, Sergey!
I am going to guess that you made your own solution from scratch, rather than upgrade the existing one.

ChildView.h and ChildView.cpp are not used in the actual project. Remove these from your solution.

Once you have done that, there is only 1 thing that needs changing. Microsoft changed the way registered thread messages are implemented, and a return value is no longer needed. Below are the only changes you should need to make to get it compiling.

QuickWin.h
C++
//Line 102: Change
//afx_msg LRESULT OnStdioCommand(WPARAM wParam, LPARAM lParam);
afx_msg void OnStdioCommand(WPARAM wParam, LPARAM lParam);


QuickWin.cpp
C++
//Line 420: Change
//LRESULT CQuickWinApp::OnStdioCommand(WPARAM wCommand, LPARAM lParam)
void CQuickWinApp::OnStdioCommand(WPARAM wCommand, LPARAM lParam)

//Line 454: Delete
//return 0;



I couldn't actually get it to do anything useful, so there must be something else that needs changing too, but I don't have the time to search for it. Hope this much helps.
 
Share this answer
 
Comments
oldbritthumper 28-Oct-11 11:08am    
Mr. Brock,
Thanks a bunch.
This worked like a charm - and though I've slung my share of code - *I* would not have figured it out.
You saved me a bunch of frustration and -
you the man!

Thanks again, Matt

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900