Click here to Skip to main content
16,005,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralThumbnails Pin
AJ12323-Aug-01 23:51
AJ12323-Aug-01 23:51 
GeneralRe: Thumbnails Pin
Not Active24-Aug-01 4:39
mentorNot Active24-Aug-01 4:39 
GeneralNeed to strip zeroes from FP value Pin
23-Aug-01 23:49
suss23-Aug-01 23:49 
GeneralRe: Need to strip zeroes from FP value Pin
Tomasz Sowinski23-Aug-01 23:54
Tomasz Sowinski23-Aug-01 23:54 
GeneralTreeCtrl&CView Pin
alexson23-Aug-01 23:28
alexson23-Aug-01 23:28 
QuestionWhat Class (MFC) Is Suitable As Canvas In Dialog Based Application Pin
23-Aug-01 22:27
suss23-Aug-01 22:27 
AnswerRe: What Class (MFC) Is Suitable As Canvas In Dialog Based Application Pin
Bernhard24-Aug-01 0:06
Bernhard24-Aug-01 0:06 
QuestionHow to send the datas in a structure using Socket Pin
23-Aug-01 20:50
suss23-Aug-01 20:50 
Could somebody please help me with this?
I have a client program and server program... I am just testing if data in specific structure is being sent to the server program..... ok... In my client program there are 3 edit boxes.. so i want these three variables being sent to server program.. so let me just write down some of source codes... and please modify it... Everthing related to socket
works fine... Using IP addresses, the client project can be connected to Server project. I guess it's a matter of receiving
datas in the structure from the server. Garbage datas are being sent to the server program....

//Those 3 variables for Edit Boxes...
CString m_Age;
CString m_Email;
CString m_Name;

// class
class sMsg
{
public:
char cUserEmail[50];
char cUserAge[10];
char cUserID[10];
};

// Client program
void CStructTestClientDlg::OnSend()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);

sMsg *msg = new sMsg;

strcpy(msg->cUserID,m_Name);
strcpy(msg->cUserAge,m_Age);
strcpy(msg->cUserEmail,m_Email);

m_ClientSocket.Send((LPVOID)msg,sizeof(msg));
}

//Server Program
void TChildSocket::OnReceive(int nErrorCode)
{

sMsg *msg = new sMsg;
m_pServerSocket->Receive(msg,sizeof(msg));
CString i = msg->cUserID; //(just checking if one variable could be printed out....)
AfxMessageBox(i);

}
AnswerRe: How to send the datas in a structure using Socket Pin
markkuk23-Aug-01 23:04
markkuk23-Aug-01 23:04 
AnswerRe: How to send the datas in a structure using Socket Pin
Anders Molin24-Aug-01 1:25
professionalAnders Molin24-Aug-01 1:25 
GeneralRe: How to send the datas in a structure using Socket Pin
markkuk24-Aug-01 2:28
markkuk24-Aug-01 2:28 
GeneralTrapping Message Pin
23-Aug-01 20:40
suss23-Aug-01 20:40 
GeneralRe: Trapping Message Pin
Tomasz Sowinski23-Aug-01 23:49
Tomasz Sowinski23-Aug-01 23:49 
GeneralTrapping Message Pin
23-Aug-01 20:40
suss23-Aug-01 20:40 
QuestionHow to Maximize a Dialog Based Program But not Covering the Task Bar? Pin
Maer72723-Aug-01 20:08
Maer72723-Aug-01 20:08 
AnswerRe: How to Maximize a Dialog Based Program But not Covering the Task Bar? Pin
24-Aug-01 3:26
suss24-Aug-01 3:26 
GeneralRe: How to Maximize a Dialog Based Program But not Covering the Task Bar? Pin
Aaron Schaefer24-Aug-01 4:34
Aaron Schaefer24-Aug-01 4:34 
Questionhow to show a window maximized but not covering the task bar? Pin
Maer72723-Aug-01 18:31
Maer72723-Aug-01 18:31 
AnswerRe: how to show a window maximized but not covering the task bar? Pin
Michael Dunn23-Aug-01 18:53
sitebuilderMichael Dunn23-Aug-01 18:53 
GeneralDate and Time Picker Pin
23-Aug-01 17:21
suss23-Aug-01 17:21 
GeneralRe: Date and Time Picker Pin
Tomasz Sowinski23-Aug-01 23:32
Tomasz Sowinski23-Aug-01 23:32 
GeneralRe: Date and Time Picker Pin
27-Aug-01 15:36
suss27-Aug-01 15:36 
Questionhow to pass a structure from one application to another using the Message Queue concept Pin
sudheer23-Aug-01 17:02
sudheer23-Aug-01 17:02 
AnswerRe: how to pass a structure from one application to another using the Message Queue concept Pin
#realJSOP24-Aug-01 0:34
professional#realJSOP24-Aug-01 0:34 
GeneralAutocomplete Pin
Matt Newman23-Aug-01 16:41
Matt Newman23-Aug-01 16:41 

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.