Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/articles/mfc-tutorials/)
-   -   Right mouse button event handler (http://www.go4expert.com/articles/mouse-button-event-handler-t381/)

shabbir 14Jun2009 08:55

Re: Right mouse button event handler
 
They compile for me on VS 2005 and I do not have 2008. What error you get ?

Panarchy 8Jul2009 03:24

Re: Right mouse button event handler
 
Sorry for the late reply;
Code:

1>------ Build started: Project: MyButton, Configuration: Debug Win32 ------
1>Compiling...
1>MyButton.cpp
1>c:\mybutton\mybutton\mybutton.h(14) : error C2504: 'CButton' : base class undefined
1>c:\mybutton\mybutton\mybutton.h(37) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\mybutton\mybutton\mybutton.h(37) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\mybutton\mybutton\mybutton.h(37) : error C2061: syntax error : identifier 'CPoint'
1>c:\mybutton\mybutton\mybutton.h(41) : error C2143: syntax error : missing ';' before '}'
1>c:\mybutton\mybutton\mybutton.h(41) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\mybutton\mybutton\mybutton.h(41) : warning C4183: 'DECLARE_MESSAGE_MAP': missing return type; assumed to be a member function returning 'int'
1>c:\mybutton\mybutton\mybutton.cpp(25) : error C2061: syntax error : identifier 'CButton'
1>c:\mybutton\mybutton\mybutton.cpp(27) : error C3646: 'ON_WM_RBUTTONUP' : unknown override specifier
1>c:\mybutton\mybutton\mybutton.cpp(29) : error C3646: 'END_MESSAGE_MAP' : unknown override specifier
1>c:\mybutton\mybutton\mybutton.cpp(29) : error C2091: function returns function
1>c:\mybutton\mybutton\mybutton.cpp(34) : error C2091: function returns function
1>c:\mybutton\mybutton\mybutton.cpp(34) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\mybutton\mybutton\mybutton.cpp(34) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\mybutton\mybutton\mybutton.cpp(34) : error C2061: syntax error : identifier 'CPoint'
1>c:\mybutton\mybutton\mybutton.cpp(38) : error C2065: 'NM_RCLICK' : undeclared identifier
1>c:\mybutton\mybutton\mybutton.cpp(39) : error C2039: 'GetSafeHwnd' : is not a member of 'CMyButton'
1>        c:\mybutton\mybutton\mybutton.h(13) : see declaration of 'CMyButton'
1>c:\mybutton\mybutton\mybutton.cpp(40) : error C2660: 'GetDlgCtrlID' : function does not take 0 arguments
1>c:\mybutton\mybutton\mybutton.cpp(41) : error C3861: 'TRACE': identifier not found
1>c:\mybutton\mybutton\mybutton.cpp(42) : error C2039: 'GetParent' : is not a member of 'CMyButton'
1>        c:\mybutton\mybutton\mybutton.h(13) : see declaration of 'CMyButton'
1>c:\mybutton\mybutton\mybutton.cpp(42) : error C2227: left of '->SendMessageW' must point to class/struct/union/generic type
1>Build log was saved at "file://c:\MyButton\MyButton\Debug\BuildLog.htm"
1>MyButton - 20 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


shabbir 8Jul2009 09:03

Re: Right mouse button event handler
 
IF CButton is not defined I guess you have to make sure you are able to compile MFC Programs

naimish 8Jul2009 09:15

Re: Right mouse button event handler
 
Cool one, need to check it first :) will reply soon

Panarchy 10Jul2009 05:48

Re: Right mouse button event handler
 
Quote:

Originally Posted by shabbir (Post 51764)
IF CButton is not defined I guess you have to make sure you are able to compile MFC Programs

Which project should I be using?

http://i32.tinypic.com/2qlahw3.jpg

Have been using Windows Forms... or win32 project.

shabbir 10Jul2009 08:49

Re: Right mouse button event handler
 
I dont see Windows Form in there but you should be using MFC application because CButton and Win32 does not go together..

Panarchy 13Jul2009 05:12

Re: Right mouse button event handler
 
Windows Forms Application

2nd one down 1st column

Makes it very easy to design a GUI...


All times are GMT +5.5. The time now is 18:03.