Click here to Skip to main content
15,909,898 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMultiple column combo box Pin
ledallam1-Dec-04 23:46
ledallam1-Dec-04 23:46 
GeneralLaunching Notepad to open a specific file Pin
Anonymous1-Dec-04 22:56
Anonymous1-Dec-04 22:56 
GeneralRe: Launching Notepad to open a specific file Pin
vaniacilli1-Dec-04 23:05
vaniacilli1-Dec-04 23:05 
GeneralRe: Launching Notepad to open a specific file Pin
ThatsAlok1-Dec-04 23:09
ThatsAlok1-Dec-04 23:09 
GeneralRe: Launching Notepad to open a specific file Pin
Arsalan Malik1-Dec-04 23:17
Arsalan Malik1-Dec-04 23:17 
GeneralRe: Launching Notepad to open a specific file Pin
Anonymous1-Dec-04 23:32
Anonymous1-Dec-04 23:32 
GeneralReading Variables Pin
gamitech1-Dec-04 22:50
gamitech1-Dec-04 22:50 
Generalabout TransmitFile Pin
yingkou1-Dec-04 22:46
yingkou1-Dec-04 22:46 
I want to use API TransmitFile to build a C/S structure ,who can give me an example.I have written a program but client program has bug,client codes as below:
UINT ClientThread(LPVOID lv)
{
SOCKET s=(SOCKET)lv;
CFile f;
bool IsOpen=false;
char buf[1024*128]="";int count=0;
while (true)
{
buf[0]='\0';
int ret=recv(s,buf,sizeof(buf),0);
if(SOCKET_ERROR == ret)
{
CString s;
s.Format("%d",WSAGetLastError());
AfxGetMainWnd()->SetWindowText(s);
break;
}
else
{
CString str(buf,ret);
int i=str.Find(':');
if(-1 != i)
{
if(f.Open(str.Right(str.GetLength()-i-
1),CFile::modeCreate|CFile::modeWrite) == 0)
break;
IsOpen=true;
}
else if("FileTranferOver" == str)
break;
else if(IsOpen)
{
try
{
f.Write(buf,ret);
}
catch (...)
{
str.Format("%d",GetLastError());
MessageBox(NULL,str,"Error",MB_OK);
}
}
else
continue;

count+=ret;
}
}
if(IsOpen)
f.Close();

CString str1;
str1.Format("%d",count);
AfxGetMainWnd()->SetWindowText(str1);

return 0;
}


GeneralLinker Error Pin
Yuvaraj N1-Dec-04 22:18
Yuvaraj N1-Dec-04 22:18 
Questionhow to resize property page??? Pin
includeh101-Dec-04 22:09
includeh101-Dec-04 22:09 
AnswerRe: how to resize property page??? Pin
PJ Arends1-Dec-04 22:33
professionalPJ Arends1-Dec-04 22:33 
GeneralRe: how to resize property page??? Pin
includeh101-Dec-04 23:47
includeh101-Dec-04 23:47 
QuestionWhich MFC control does this? Pin
Vancouver1-Dec-04 19:39
Vancouver1-Dec-04 19:39 
AnswerRe: Which MFC control does this? Pin
Cedric Moonen1-Dec-04 19:55
Cedric Moonen1-Dec-04 19:55 
GeneralRe: Which MFC control does this? Pin
Vancouver2-Dec-04 10:58
Vancouver2-Dec-04 10:58 
GeneralATL support to existing MFC application Pin
Ro_land1-Dec-04 19:26
Ro_land1-Dec-04 19:26 
GeneralRe: ATL support to existing MFC application Pin
Antony M Kancidrowski2-Dec-04 6:10
Antony M Kancidrowski2-Dec-04 6:10 
GeneralRe: ATL support to existing MFC application --> IT's POSSIBLE, it works !!! Pin
Roland Rubichi2-Dec-04 12:03
Roland Rubichi2-Dec-04 12:03 
QuestionHow to make a simple opengl32.dll Pin
maxmaven1-Dec-04 19:04
maxmaven1-Dec-04 19:04 
AnswerRe: How to make a simple opengl32.dll Pin
BlackDice2-Dec-04 3:01
BlackDice2-Dec-04 3:01 
GeneralNeed help using WinInet (making http requests) Pin
GrefMofovich1-Dec-04 18:56
GrefMofovich1-Dec-04 18:56 
Questionhow to store a value Pin
zahid_ash1-Dec-04 18:47
zahid_ash1-Dec-04 18:47 
AnswerRe: how to store a value Pin
RChin1-Dec-04 22:37
RChin1-Dec-04 22:37 
QuestionWill SP5 work ? Pin
Ritu Kwatra1-Dec-04 18:01
Ritu Kwatra1-Dec-04 18:01 
AnswerRe: Will SP5 work ? Pin
RChin1-Dec-04 22:30
RChin1-Dec-04 22:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.