Thread: how do i use a thread to do this...

  1. #1
    Registered User (TNT)'s Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    339

    Cool how do i use a thread to do this...

    Hi,

    I am making a program that uploads a file. While it is uploading the program stops responding.

    I want to do all of my ftp stuff in a seperate thread. So basically the program is always responding.

    I have no experince with threads, so could someone show me how to create a thread and do stuff within it.

    Thanks in advance
    TNT
    TNT
    You Can Stop Me, But You Cant Stop Us All

  2. #2
    Registered User Esss's Avatar
    Join Date
    Aug 2001
    Posts
    133
    Use _beginthread.
    Ess
    Like a rat in a maze who says,
    "Watch me choose my own direction"
    Are you under the illusion
    The path is winding your way?
    - Rush

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    tsk,tsk,tsk - _beginthreadex(). I haven't used it in so long I think I'd need petzold's to do it There's also a function which makes windows and winsock play nice together...I forget what it's called (sorry!) I think it's in my favorites list somewhere...lemme find it...I'll post it when I do.

  4. #4
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    WSAAsyncSelect() is the function...I got it from here http://world.std.com/~jimf/papers/sockets/winsock.html if you need an example. here's a search I did with msdn.microsoft.com, but it didn't come out ith too many results, just some examples and some MFC initializations of it:

    http://search.microsoft.com/us/dev/d...WSAASYNCSELECT

    hope that helps!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Thread Synchronization in Win32
    By passionate_guy in forum C Programming
    Replies: 0
    Last Post: 02-06-2006, 05:34 AM
  2. [code] Win32 Thread Object
    By Codeplug in forum Windows Programming
    Replies: 0
    Last Post: 06-03-2005, 03:55 PM
  3. Win32 Thread Object Model Revisted
    By Codeplug in forum Windows Programming
    Replies: 5
    Last Post: 12-15-2004, 08:50 AM
  4. Simple thread object model (my first post)
    By Codeplug in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2004, 11:34 PM
  5. Problem : Threads WILL NOT DIE!!
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2004, 01:37 PM