CSocketFile

This is a discussion on CSocketFile within the Windows Programming forums, part of the Platform Specific Boards category; Does anyone know how to pass objects using CArchive from a cleint application to a server application ? For example ...

  1. #1
    Unregistered
    Guest

    CSocketFile

    Does anyone know how to pass objects using CArchive from a cleint application to a server application ?

    For example if I wanted to pass int i=100 from one application to the next using a CSocketFile and CArchive objects , how can I do this?

    I've read the MSDN documentation but the data doesn't seem to get through to the next side.
    Can anyone help?

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    32
    I have no idea what CSocketFile or CArchive is... but to do it using C (not C++) you would simply do the following...

    Code:
    int main()
    {
    int i=100;
    char StringtoSend[100];
    
    // Initialize Winsock
    // Connect to server
    
    sprintf(StringtoSend, "%d", i);
    send(socket, StringtoSend, strlen(StringtoSend), 0);
    }
    I'm not sure how to do it with the way you want it to, but thats how I do it and so maybe you can work with it a bit to figure out your problem? I'm not sure.
    cerion
    Use the code Luke.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21