Advertisement Jump to content
Sign in to follow this  

Jim Adams Server/Client

This topic is 4880 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone. I'm a bit upset here. I've had problems with Jim Adam's code since I've bought his book. Im trying to compile the server and client but get the following errors: Build [C++ Warning] Core_System.h(50): W8058 Cannot create pre-compiled header: initialized data in header [C++ Error] WinMain.cpp(596): E2034 Cannot convert 'int (__stdcall *)(void *,unsigned int,unsigned int,long)' to 'int (__stdcall *)()' [C++ Error] WinMain.cpp(596): E2342 Type mismatch in parameter 'lpDialogFunc' (wanted 'int (__stdcall *)()', got 'int (__stdcall *)(void *,unsigned int,unsigned int,long)') [C++ Error] WinMain.cpp(646): E2243 Array allocated using 'new' may not have an initializer Ok, so I look at the code and notice... // Open connection dialog Result=DialogBox(GethInst(), MAKEINTRESOURCE(IDD_CONNECT), GethWnd(), ConnectDialogProc); Ok, so I figure the ConnectDialogProc); should be ConnectDialogProc(); nope.. Build [C++ Error] WinMain.cpp(687): E2219 Wrong number of arguments in call of macro 'DialogBoxA' [C++ Error] WinMain.cpp(687): E2451 Undefined symbol 'Dist' [C++ Error] WinMain.cpp(687): E2451 Undefined symbol 'Speed' [C++ Error] WinMain.cpp(691): E2451 Undefined symbol 'i' [C++ Error] WinMain.cpp(701): E2451 Undefined symbol 'XMove' [C++ Error] WinMain.cpp(702): E2451 Undefined symbol 'ZMove' [C++ Warning] WinMain.cpp(767): W8070 Function should return a value I tried building both the original code that came on cd AND his code after updating it, none of which work. Anyone else have problems compiling his code? I'm very dissapointed that I payed good money for something thats obviosly been broken for a LONG time.

Share this post

Link to post
Share on other sites

Hi Nashoc3

From looking at your output it looks like you are using a borland compiler, probably C++ Builder or such.

C++ Builder can handle some of the casts differently than how VC++ would. Not right or wrong just different....

Result=DialogBox(GethInst(), MAKEINTRESOURCE(IDD_CONNECT), GethWnd(), ConnectDialogProc);

is correct, however it looks to me like it's the handling of the ConnectDialogProc definition that is generating the
E2034 and E2342.

Since I don't have borland I can't tell you for sure what the problem is. A google search reveals similiar problems with different code bases.

I would start by changing the BOOL to LRESULT for the
BOOL CALLBACK ConfigDialogProc(HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam)

There's some sample code for a dialog box using borland here:
And more info here

I'd verify I'm using the the latest platform SDK as well.

Failing this you might want to d/l VC C++ express (I'm able to build it with that 2nd edition code btw), it's free for now, but I can understand you'd rather get your prefered environment to work, this type of thing can be frustrating.

Good Luck,
- James

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!