|
Probably the buffer you're writing to the output file does not contain the whole info. I think you have to check how many bytes are actually transferred between the client and the server.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Before I sent contents of file I am sending the length or size of file.
And I am recieving lenght of file.
I am using that length in recv() function.
It is working fine for .gif file.
Thank You...
Vijay.
|
|
|
|
|
You may check the received buffer content with the debugger.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I need to create a progress bar for my application and i added the progress control to my dialogbox,and added the following code,while i run the project i can see only a empty progress bar,and no progress is shown,i don't know how to work with the progress bar,and i need to add a status bar to it also.How is that done???pls help me as iam new to MFC concepts.
void CmobtvapplicationDlg::OnNMCustomdrawProgress1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMCUSTOMDRAW pNMCD = reinterpret_cast<LPNMCUSTOMDRAW>(pNMHDR);
CProgressCtrl *Progress = new CProgressCtrl;
Progress->Create(WS_CHILD | WS_VISIBLE, CRect(10, 10, 288, 35), this,0x16);
Progress->SetRange(0, 100);
Progress->SetPos(0);
if (Progress->GetPos()!=100)
{
Progress->StepIt();
}
else
{
Progress->SetPos(10);
}
*pResult = 0;
}
RAJA
modified on Sunday, May 4, 2008 11:46 PM
|
|
|
|
|
I suspect you need to run your main code in a seperate thread so that your progress bar is responsive.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Please, reply here, I don't respond to emails b/c I don't give out my address.
I'm sorry, but you'll need to read up on multithreading, if you don't understand what I meant. Yes, you can put it in your status bar, I'm sure there are articles on how to do that.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Why you put the code inside the custom draw function (OnNMCustomdrawProgress1) of the progress bar itself. This function is called only if the Progreesbar is having OWner draw style.Whether you want to show another progress control when the custom draw function of the progress1 is called???.
thanks,
Nitheesh
|
|
|
|
|
no,i need to draw a progress bar dynamically when i press a button and the progress should be shown untill a listbox is filled,what should i do for that???shouldn't i create a progresscontrol on dialog box????what else should i do???
RAJA
|
|
|
|
|
Why you dont use of ToolBox for make progressbar and also I told you you must remove declare of this control of a function.
|
|
|
|
|
i have used a toolbar to draw the progress abr only...but,I need the display of the progressbar when i click a button and the progress should be shown untill a operation is completed,and so,where should i add the progress bar???what coding has to be done??i don't get the progress shown if the above shown coding is put!!!!!!
RAJA
|
|
|
|
|
Hi,
Place your ProgressBar Creation code in OnInitDialog (override it) and make control hidden. Then in your button click event handler make it visible and set its bar position's.
Or
you can place a progress control bar and make it visible false. then do in button click event handler as said above.
And increment the bar position in the list fill function.
thanks
Nitheesh
|
|
|
|
|
Project RAJA wrote: ...while i run the project i can see only a empty progress bar,and no progress is shown...
So which is it, empty or invisible?
Did you mean to create the control at run time rather than at dsign time?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello
I Need A Simple MFC Project With Use DataBase In That and Programming Via Microsoft Visual Studio 2003 Like This Image :
http://i28.tinypic.com/n4b04g.jpg
My Project's Source Code Too Is Here :
http://uploadbazar.com/748PVD.zip
Please Help Me
How I Can Use Database In My Project ?
Thanks
Regards
Mohsen.Alipour@Hotmail.com
|
|
|
|
|
Mohsen.Alipour wrote: How I Can Use Database In My Project ?
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
as the topic,and also I want to get the Expection infomation if an exception threw out when compiling a source file,e.g stack overflow.There will be much information the program can catch.
how could I carry out this?any one can help me?
thanks in advance.
no cross no crown.
|
|
|
|
|
|
I'm using Visual C++ 6.0 - I'm new to windows programming.
I have a pop-up window where users enter data. It is setup as dialog using Visual C++. Sometimes I would like to display a note in this window that says "inches" and other times I would like this note to say "millimeters". I learned how to put up static messages, but I don't understand how to change them based on a variable in my C++ code. What is the simplest approach? Thanks ahead of time.
|
|
|
|
|
Are you using MFC? If so, you can add a CStatic control variable
to the window class, and use the CStatic::SetWindowText() method to
change the control's text.
You should be able to add the control object from the dialog editor...
right click the text control and chose "Add variable..." (I can't remember
exactly in VC6).
*edit* Actually, adding a string variable for the static control and using <br />
DDX is another possibly simpler MFC solution. I seem to have neglected that<br />
previously
If you use straight Win32, you can use the SetWindowText() API directly
on the control, something like:
HWND hwndControl = ::GetDlgItem(hwndDialog, IDC_MYSTATICCONTROL);
::SetWindowText(hwndControl, _T("New Text!"));
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for the reply. Your answer changes the title of the window, but it led me to find the function:
void SetDlgItemText( int nID, LPCTSTR lpszString );
which seems to work okay for what I want.
|
|
|
|
|
For SetWindowText you need to a handle to controls but with SetDlgItemText you can use of control id.
|
|
|
|
|
Kwanalouie wrote: Your answer changes the title of the window
Not if the right HWNDs are used. For a static text/edit control HWNDs, the text
of the control should be set.
SetDlgItemText is great - it combines GetDlgItem() with SetWindowText() into one call
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: You should be able to add the control object from the dialog editor...
right click the text control and chose "Add variable..." (I can't remember
exactly in VC6).
you have to change name of IDC_STATIC to some else,to make editor aware that you want to add variable to that static control!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
You can use of Get/SetwindowText or WM_GETTEXT/WM_SETTEXT for get or set text toa control.
|
|
|
|
|
How can I free memory before returning the value in my function?. Here's the code, thank you very much.
int FindString(char*s, char* what, int len, int len2)
{
char * x = s;
for (int i = 0;i<len;i++,*x++)
{
if(memicmp(x,what,len2) == 0)
{
cout <<; "I found it @ " << i << endl;
return i;
}
}
return -1;
}
char *rr(char*s)
{
char cc[4] = {0x00,0x00,0x00,0x00};
int i =FindString(s,cc,512,4);
if( i > 0)
{
char * New = new char[i];
memcpy(New,s,i);
// How can I use 'delete' here before returning New???
return New;
}
return NULL;
}
|
|
|
|
|
Why do you want to delete the array before returning the pointer
to the caller? What are you trying to achieve?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|