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

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

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

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

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?

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++.

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"

Hi thanks for ur reply.

The code is like this,
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <zmouse.h>

I included <windows.h>. Then it is giving the following error

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

What I have to do now?

Thanku


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

Post copy-and-paste of real code, not "like this" paraphrasing.

I included <windows.h>.

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.

This article has been dead for over six months. Start a new discussion instead.