473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

error: 'static_cast' : cannot convert from 'void (__thiscall CShimiHalDlg::* )(void)'

17
Hello ,
i want a solution for this error:
Expand|Select|Wrap|Line Numbers
  1.  'static_cast' : cannot convert from 'void (__thiscall CShimiHalDlg::* )(void)' to 'AFX_PMSG'
this error occurred when i added a button and writing code for it in a mfc project.
i searched for it in the web and found some solution like change it's prototype from void to LRESULT i do it but this error occurred:
Expand|Select|Wrap|Line Numbers
  1. error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall CshimiHalDlg::* )(WPARAM,LPARAM)' to 'AFX_PMSG'
please get me a solution
Best Regard
Aug 7 '10 #1
3 5240
hype261
207 100+
You need to show the line of code where the error is occuring, without that it is going to be very hard to see what is going wrong in your program.
Aug 7 '10 #2
zahraZ
17
this is the code of it:
Expand|Select|Wrap|Line Numbers
  1. BEGIN_MESSAGE_MAP(CHalManshorDlg, CDialog)
  2.     ON_BN_CLICKED(IDC_ManshorHal, &CHalManshorDlg::OnBnClickedManshorhal)
  3. END_MESSAGE_MAP()
and Here is the definition of OnBnClickedManshorhal() function
Expand|Select|Wrap|Line Numbers
  1. void CHalManshorDlg::OnBnClickedManshorhal()
please solve it.
thanks very alot
Aug 7 '10 #3
weaknessforcats
9,208 Expert Mod 8TB
You should post where the static cast is being done.

Posting a macro is not posting the error. You may need to post the macro expansion.
Aug 9 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ketil B | last post by:
Hi All Im geting the compiler error error C2440: '=' : cannot convert from 'short (__thiscall CMSComm::*)(void)' to 'short on this line sCommEvent = m_ctlMSComm.GetCommEvent
1
by: Gary | last post by:
I have a strange compile error. C2664 cannot convert parameter 2 from int to int... Earlier in my code I was setting up my dataset... I add an int field like so... ...
9
by: Igor Okulist | last post by:
int func(void**); { short* p = NULL; func(&p); //<<< here } Could somebody remind me why is this not allowed ? error message: "cannot convert parameter from 'short **' to 'void **'"
2
by: Christophe | last post by:
class A {} class B {} interface MyInterface { void method(A a); void method(B b); }
1
by: stillh2os | last post by:
Hello. I'm new to .NET, and I'm trying to implement a callback function. I want my managed C++ code to call an unmanaged function, passing in a callback function that the unmanaged C/C++ code...
3
by: mishink7 | last post by:
i am getting this error error C2662: 'std::vector<_Ty>::push_back' : cannot convert 'this' pointer from 'const std::vector<_Ty>' to 'std::vector<_Ty> &' with and ...
2
by: nomad | last post by:
Hi, When trying to serialize a class I keep getting the message below. optionalExtensionTypeOptionalExtension is not mandatory so not sure why this is appearing. If anyone has seen this type...
2
by: slizorn | last post by:
error is as stated in the topic above: error C2440: '=' : cannot convert from 'char *' to 'char' code is below void handleOneLine(string string1) { char * cstr, *p; int counter; string...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.