|
With Windows Sockets there's the TransmitFile() API (NT 3.51+).
You can also open the file, read a chunk of bytes into a buffer, send the buffer.
On the reveiving side create a file, receive a chunk of bytes into a buffer, write the bytes to
the file.
There are no byte order issues.
Mark
|
|
|
|
|
Yanshof wrote:
he TCP connection is not my problem - my problem\question is - how to read the file and send it to other side ? I know that i need to send the file as byte order - but i don't know how to do it.
open file in binary mode and send chunk by chunk.. remember Sliding Window Protocol!
<div class='ForumSig'>"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you </div>
|
|
|
|
|
how do i drag(move) dialog that doesn't hav title bar?
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
BlitzPackage wrote: ...and assign the necessary variables for the control, but it absolutely refuses to let me do so. I know there is some simple step that I'm forgetting.
Like using ClassWizard (Ctrl+W)? Of course, you can always do it manually.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Talking to yourself again?
|
|
|
|
|
Mark Salsbery wrote: Talking to yourself again?
No, BlitzPackage apparently deleted his post, thus orphaning mine.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Maybe he gets his answer then delete his question
|
|
|
|
|
Very stealthy.
The masked inquisitor strikes again!
|
|
|
|
|
Hi,
I can get the ActiveX ID from Client by using GetCtrlID, but I need to get the ID from ActiveX itself by calling GetCtrlId in ActiveX itself.
(in the same way as we get for a Dialog using dialogobj.GetCtrlID)
If I use it in ActiveX iam getting it as Zero in Client.
Thanks in Advance
Today is a gift, that's why it is called the present.
|
|
|
|
|
Hi, All
In one function of my project I need a 2-D vector array consisting of elements of struct STRU_A.
struct STRU_A{
char ch[20];
float score;
};
However, the two dimensions both dynamic. That is, the dimension sizes depend on the input to the function.
How to declare and use a 2-D vector array of such kind.
thank you
|
|
|
|
|
Use a double std::vector.
typedef std::vector< std::vector< STRU_A> > T2DArray;
The typedef is usefull so that you can easily declare a new instance without typing everything:
T2DArray MyArray;
|
|
|
|
|
|
Hi,
Iam using VC8.0 .
I have a dialog with two buttons placed on Left side.I Invoke Domodal dialog boxes having no borders with each button clicks.
SettingsDlg.DoModal();
In One of the DoModal diaog invoked I have an Edit box.In OnOK of that Dialog box I check for the EditBox validation if Nothing is entered I return the before CDialog::OnOk prompting the user to type the text.
if(m_strProfileName.IsEmpty())
{
AfxMessageBox(_T("Profile Name must be Entered"));
GetDlgItem(IDC_EDIT_PROFILE_NAME)->SetFocus();
return;
}
OnOK();
The Problem Iam facing is upon clicking OnOk without entering the Text in Edit box Iam losing the Focus.Now, If I click other button its DoModal Dialog box is getting Invoked even when the First DoModal is there.
How can I overcome this problem? Any Suggestions would be helpful.
Today is a gift, that's why it is called the present.
|
|
|
|
|
your editbox certainly has the focus, but without selection. isn't it what you want ?
if so, add a SetSel(0, -1); call after your SetFocus()
|
|
|
|
|
yes my edit box has the focus , but when I click other button its Onclick handler shouldnot execute as Is the Funtionality of the DoModal.i.e when we DoModal until we close the dialog no other function can be done on other windows.
I think you got my point
As I specified I have a main dialog box with two buttons.
On each button click iam invoking a DoModal Dialog Box.
When I click a button,Until I close the DoModal I cant click the Other button.
But for me I could click the Other button.
Today is a gift, that's why it is called the present.
|
|
|
|
|
can you please show a piece of code ? (don't forget to use the <pre> tag for code samples)
|
|
|
|
|
On one of the Button Click domodal dialog appears whose class is CCreateProfileDlg
void CCreateProfileDlg::OnBnClickedOk()
{
UpdateData(TRUE);
if(m_strProfileName.IsEmpty())
{
AfxMessageBox(_T("Profile Name must be Entered"));
GetDlgItem(IDC_EDIT_PROFILE_NAME)->SetFocus();
return;
}
---------
--------------
OnOK();
}
BOOL CCreateProfileDlg::OnInitDialog()
{
CDialog::OnInitDialog();
this->PostMessage(WM_MOVE_PROFILEDIALOG,0,0);
return TRUE;
}
LRESULT CCreateProfileDlg::OnMoveProfileDialog(WPARAM,LPARAM)
{
this->MoveWindow(275,325,400,280);
return TRUE;
}
-------------------------------------------------------------------
in my Maindialog class
in .h
CCreateProfileDlg m_profileSettingsDlg;
in .cpp
void CEFCHomeDlg::ClickedProfileCreate()
{
if(m_profileSettingsDlg.DoModal() == IDOK)
{
}
}
-------------------------------------------
On other Button Click also a domodal dialog appears whose class has similar code as of CCreateProfileDlg.
-------------------------------------------------
Actually iam using ActiveX controls in place of Buttons
<div class="ForumSig">Today is a gift, that's why it is called the present.</div>
|
|
|
|
|
narayanagvs wrote: if(m_strProfileName.IsEmpty())
{
AfxMessageBox(_T("Profile Name must be Entered"));
GetDlgItem(IDC_EDIT_PROFILE_NAME)->SetFocus();
return;
}
OnOK();
A better design would be to disable the OK button until m_strProfileName is non-empty.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to open file with my program using right click at that file.
(similar as when I want to scan virus,I just right click and select program from pop-up menu)
Anybody know how I write the code
|
|
|
|
|
You mean a "right click" on the file in the windows explorer view, where you can select "open with" or similar the application?
--> thats a registry "hack"
|
|
|
|
|
|
|
i know, but your link is written at the bottom of the article i provided...
you start reading by the beginning, don't you ?!
|
|
|
|