Sockets in windows gl programs
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement