User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 391,548 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,539 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 2155 | Replies: 9
Reply
Join Date: Jun 2006
Posts: 8
Reputation: angle188.shroff is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
angle188.shroff angle188.shroff is offline Offline
Newbie Poster

errors while executing vc++ code

  #1  
Jun 9th, 2006
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2004
Posts: 3,449
Reputation: Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light 
Rep Power: 16
Solved Threads: 138
Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: errors while executing vc++ code

  #2  
Jun 9th, 2006
While my crystal ball is out for polishing, why not post the lines of code associated with these errors?
Reply With Quote  
Join Date: Jun 2006
Posts: 8
Reputation: angle188.shroff is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
angle188.shroff angle188.shroff is offline Offline
Newbie Poster

Re: errors while executing vc++ code

  #3  
Jun 12th, 2006
Originally Posted by Dave Sinkula
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
Last edited by cscgal : Jun 12th, 2006 at 4:27 pm.
Reply With Quote  
Join Date: Dec 2005
Posts: 3,257
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 20
Solved Threads: 368
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: errors while executing vc++ code

  #4  
Jun 12th, 2006
What about your source code, does it include windows.h before including any other windows header file?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Reply With Quote  
Join Date: Jun 2006
Posts: 8
Reputation: angle188.shroff is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
angle188.shroff angle188.shroff is offline Offline
Newbie Poster

Re: errors while executing vc++ code

  #5  
Jun 12th, 2006
Originally Posted by Salem
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
Reply With Quote  
Join Date: Apr 2004
Posts: 3,449
Reputation: Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light 
Rep Power: 16
Solved Threads: 138
Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: errors while executing vc++ code

  #6  
Jun 12th, 2006
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?
Last edited by Dave Sinkula : Jun 12th, 2006 at 9:24 am.
Reply With Quote  
Join Date: Jun 2006
Posts: 8
Reputation: angle188.shroff is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
angle188.shroff angle188.shroff is offline Offline
Newbie Poster

Re: errors while executing vc++ code

  #7  
Jun 13th, 2006
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++.
Reply With Quote  
Join Date: Apr 2004
Posts: 3,449
Reputation: Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light 
Rep Power: 16
Solved Threads: 138
Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: errors while executing vc++ code

  #8  
Jun 13th, 2006
Is it this?
Originally Posted by angle188.shroff
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"
Last edited by Dave Sinkula : Jun 13th, 2006 at 9:33 am.
Reply With Quote  
Join Date: Jun 2006
Posts: 8
Reputation: angle188.shroff is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
angle188.shroff angle188.shroff is offline Offline
Newbie Poster

Re: errors while executing vc++ code

  #9  
Jun 14th, 2006
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


Reply With Quote  
Join Date: Apr 2004
Posts: 3,449
Reputation: Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light 
Rep Power: 16
Solved Threads: 138
Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: errors while executing vc++ code

  #10  
Jun 14th, 2006
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C++ Marketplace
Thread Tools Display Modes

Other Threads in the C++ Forum

All times are GMT -4. The time now is 9:01 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC