Advertisement

Sockets in windows gl programs

Started by January 02, 2001 03:12 AM
1 comment, last by rask 23 years, 10 months ago
Ok, I made a small program based off of nehe''s tutorial #13. I added windows.h and winsock.h and started coding away at some sockets stuff. I''m now trying to serialize data and to do that I need CArchives and CObjects, which need afx.h, which wont compile if windows.h has been included. But the problem is winsock.h includes windows.h so how do i get sockets to work when i can''t include winsock?
Hi.

Those things all all MFC. If by Serialize you mean "Save" then just write your own save routine. Its a much better way of doing things than using MFC.

You can even write a CArchive object yourself. Its not hard, just have a class that overloaded the left and right shift operators for each of the basic types you want to save/load. This class will just output the values to a file or zip archive or down a socket to a server...The choices are endless!

As for Sockets, I saw a very nice set of wrapper classes using straight Sockets on www.codeproject.com

Pete
Advertisement
hmm, I think i know how to do it know, thanks for the help.

Never did like MFC

This topic is closed to new replies.

Advertisement