|
-
May 18th, 1999, 03:13 AM
#1
How Can I Send File use CSocket In Thread Mode
Hello EveryBody:
I have a Promplem To Write a Socketprogram.
Program like this is right:
class clientsock ublic CSocket
{
...
}
void clientsock::OnReceive(int nErrorCode)
{
if(nErrorCode==0)
{
....
CFile f11("c:\\a33.exe",CFile::modeRead);
while(f11.Read(by,1024)>0)
{
Send(by,1024);
}
f11.Close();
}
}
//*************************************************************
But I want to Send file in CWinThread Mode,Program like this is Error!!!
class mythread ublic CWinThread
{
...
}
mythread::Ininstance()
{
CFile f11("c:\\a33.exe",CFile::modeRead);
while(f11.Read(by,1024)>0)
{
Send(by,1024);
}
}
void clientsock::OnReceive(int nErrorCode)
{
if(nErrorCode==0)
{
....
thread_c2=new mythread();
thread_c2->CreateThread();
}
}
Cn You Help Me? Thank You Very much!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|