954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

errors while executing vc++ code

Hi

I have one opensource of vc++. While executing this code it is giving the following errors.

1)error C2433: 'HWND' : 'inline' not permitted on data declarations

2)error C2143: syntax error : missing ';' before '{'

3)error C2447: '{' : missing function header (old-style formal list?)

4)error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

5)error C2086: 'int CALLBACK' : redefinition

If any one got these errors and knew the solution please let me know.

Thank You
angle

angle188.shroff
Newbie Poster
8 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

While my crystal ball is out for polishing, why not post the lines of code associated with these errors?

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 
While my crystal ball is out for polishing, why not post the lines of code associated with these errors?




Hi,
Thanks for ur reply. Here I am posting the errors and codelines where i am getting the errors.

1)Error 1 error C2146: syntax error : missing ';' before identifier 'HwndMSWheel' c:\program files\microsoft visual studio 8\vc\platformsdk\include\zmouse.h 141

2)Error 2 error C2433: 'HWND' : 'inline' not permitted on data declarations c:\program files\microsoft visual studio 8\vc\platformsdk\include\zmouse.h 141

3)Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft visual studio 8\vc\platformsdk\include\zmouse.h 141

4)Error 4 error C2065: 'PUINT' : undeclared identifier c:\program files\microsoft visual studio 8\vc\platformsdk\include\zmouse.h 142

5)Error 5 error C2146: syntax error : missing ')' before identifier 'puiMsh_MsgMouseWheel' c:\program files\microsoft visual studio 8\vc\platformsdk\include\zmouse.h 142

6)Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft visual studio 8\vc\platformsdk\include\zmouse.h 142

7)Error 7 error C2059: syntax error : ')' c:\program files\microsoft visual studio 8\vc\platformsdk\include\zmouse.h 146

8)Error 8 error C2143: syntax error : missing ';' before '{' c:\program files\microsoft visual studio 8\vc\platformsdk\include\zmouse.h 148

9)Error 9 error C2447: '{' : missing function header (old-style formal list?) c:\program files\microsoft visual studio 8\vc\platformsdk\include\zmouse.h 148

The code is:

__inline HWND HwndMSWheel( (141)
PUINT puiMsh_MsgMouseWheel, (142)
PUINT puiMsh_Msg3DSupport,
PUINT puiMsh_MsgScrollLines,
PBOOL pf3DSupport,
PINT piScrollLines) (146) 
 
{ (148)
HWND hdlMsWheel;
hdlMsWheel = FindWindow(MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE);
*puiMsh_MsgMouseWheel = RegisterWindowMessage(MSH_MOUSEWHEEL);
*puiMsh_Msg3DSupport = RegisterWindowMessage(MSH_WHEELSUPPORT);
*puiMsh_MsgScrollLines = RegisterWindowMessage(MSH_SCROLL_LINES);
if (*puiMsh_Msg3DSupport)
*pf3DSupport = (BOOL)SendMessage(hdlMsWheel, *puiMsh_Msg3DSupport, 0, 0);
else
*pf3DSupport = FALSE; // default to FALSE
if (*puiMsh_MsgScrollLines)
*piScrollLines = (int)SendMessage(hdlMsWheel, *puiMsh_MsgScrollLines, 0, 0);
else
*piScrollLines = 3; // default
return(hdlMsWheel);
}


I think this is helpful for u to find the solutions.
Thanku
angel

angle188.shroff
Newbie Poster
8 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

What about your source code, does it include windows.h before including any other windows header file?

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 
What about your source code, does it include windows.h before including any other windows header file?



Hi Thanks for ur response.
In my source code windows.h is not included. afxwin.h is included in that code.

Thanku

angle188.shroff
Newbie Poster
8 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

As the diagnostic message is heavily hinting for you to do, look at the code before line 141.Error 1 error C2146: syntax error : missing ';' before identifier 'HwndMSWheel' c:\program files\microsoft visual studio 8\vc\platformsdk\include\zmouse.h 141

__inline HWND HwndMSWheel(                             /* 141 */
                           PUINT puiMsh_MsgMouseWheel, /* 142 */
                           PUINT puiMsh_Msg3DSupport,
                           PUINT puiMsh_MsgScrollLines,
                           PBOOL pf3DSupport,
                           PINT piScrollLines)         /* 146 */

{ /* 148 */
   HWND hdlMsWheel;
   hdlMsWheel = FindWindow(MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE);
   *puiMsh_MsgMouseWheel = RegisterWindowMessage(MSH_MOUSEWHEEL);
   *puiMsh_Msg3DSupport = RegisterWindowMessage(MSH_WHEELSUPPORT);
   *puiMsh_MsgScrollLines = RegisterWindowMessage(MSH_SCROLL_LINES);
   if ( *puiMsh_Msg3DSupport )
      *pf3DSupport = (BOOL)SendMessage(hdlMsWheel, *puiMsh_Msg3DSupport, 0, 0);
   else
      *pf3DSupport = FALSE; // default to FALSE
   if ( *puiMsh_MsgScrollLines )
      *piScrollLines = (int)SendMessage(hdlMsWheel, *puiMsh_MsgScrollLines, 0, 0);
   else
      *piScrollLines = 3; // default
   return(hdlMsWheel);
}


Why do you have code in a header?

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

It's not my code. It is a opensource which I got from one site. I have to analyse that code. So that I want to execute it. Moreover I am new to VC++.

angle188.shroff
Newbie Poster
8 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

Is it this ?In my source code windows.h is not included. afxwin.h is included in that code. What's in afxwin.h? You need to #include <windows.h> before you #include "zmouse.h" .

#include <windows.h>
#include "zmouse.h"
Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

Hi thanks for ur reply.

The code is like this,
#include
#include
#include
#include
#include

I included . Then it is giving the following error

Error 1 fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxv_w32.h 16

What I have to do now?

Thanku

angle188.shroff
Newbie Poster
8 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

Boy, you're really trying hard not to be helped.

Post copy-and-paste of real code, not "like this" paraphrasing.I included .Where?!? This is important to the question.

So, you've got an MFC project? Why are you adding old mouse stuff to it? I know neither area very well, but please tell us what the heck you are trying to do.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You