Click here to Skip to main content
15,896,342 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have source code for online game with c++ 2003 so hard for me to make it work on 2010 or newer i am using c++ 2003, so i fix some error but one error i can`t fix it .. i am newbie ... thanks

error C2039: 'ReadClientMessage' : is not a member of 'CPSock'
c:\Users\RAMBO\Desktop\DBSRV\CPSock.h(62) : see declaration of 'CPSock'

the line code:
C++
char temp[256];
			int Error;
			int ErrorCode;
            while(1)                    
			{	char*Msg =  pAdmin[User].cSock.ReadClientMessage(&Error,&ErrorCode);       ReadMessage(&Error,&ErrorCode); 
				if (Msg==NULL) break;
				////////////////////////////////
	            #ifdef  _PACKET_DEBUG
				MSG_STANDARD * debug = (MSG_STANDARD*) Msg;
				if	(BASE_CheckPacket(debug))
				{	sprintf(temp,"err packet Type:%d Size:%d",debug->wType,debug->wPDULength);
					Log(temp,"-system",0);
				}
				#endif


What I have tried:

i tried to remove those line and i got so many errors
Posted
Updated 16-Mar-20 6:46am
v3
Comments
Rick York 16-Mar-20 11:29am    
I used VS2003 for a long, long time. Then I jumped to VS2008 and then VS2017 and I found the code really did not have to change very much at all. Only a few things specific to MFC had to. Otherwise the moves were quite painless. You can now utilize some new language features from C++11 and C++17 if you do migrate. VS2017 and VS2019 can be obtained for free so I wouldn't hesitate to do so.

The type of pAdmin[User].cSock is the class CPSock. However, CPSock does not have a function called ReadClientMessage. You could look at CPSock to see if another function might have been intended, or it could be that some of the code for CPSock is missing.
 
Share this answer
 
do i can make it work on visual studio 2010 + .. i think that better , any idea?
 
Share this answer
 
Comments
Greg Utas 16-Mar-20 15:44pm    
It won't work *anywhere* until the missing function is provided. There's nothing wrong with VS2017. It's free and I use it for over 200K lines of code.
Ahmed Adel 16-Mar-20 16:25pm    
do you have facebook or whatsapp for more help ?
Greg Utas 16-Mar-20 19:25pm    
I have neither, and I can't help beyond what I've said. You need to find the complete source code for this.

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



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