Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, Is it possible to place a MessageBox option in the DLL code which was not built as an MFC dll. in VC++ 6.0 Platform. If possible, please let me know which header file is required. Because I have tried # include windows.h. However, I have got the error as
“error C2501: 'MessageBoxA' : missing storage-class or type specifiers” and “error C2373: 'MessageBoxA' : redefinition; different type modifiers”
I have given try doing changes in project setting as Project Settings->General Tab -> Microsoft Foundation Classes: -> Pull down menu has tree options 1. Not Using MFC
2. Use MFC in a Static Library and 3.Use MFC in a Shared DLL . I have tried all these three option, however, error C2501 and error C2373 are still present. Please suggest me that in this condition how would be Popup Message can display. I believe that MessageBox is MFC class member function. I am not looking only MessageBox, I am ok with any kind of function or member function or API which will prompt to user about error message. I will appreciate help. Thank you.
Posted

1 solution

MessageBox() is a WinAPI function, not MFC, so you don't need MFC at all to use it (the MFC version is AfxMessageBox()).

The MSDN description tells you everything you need to know:
http://msdn.microsoft.com/en-us/library/ms645505%28v=vs.85%29.aspx[^]

[edit]
Actually, there is a CWnd::MessageBox() but of course that's also MFC.
[/edit]
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 22-May-11 0:50am    
Correct answer, a 5.
--SA
Albert Holguin 22-May-11 16:21pm    
thanks SA

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

  Print Answers RSS


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