|
have you tried with file compare tools like windiff.
|
|
|
|
|
vijay_k wrote: can any one tell me what might be the reason behind that?
Only CP members with superpowers and the CPMRU (Code Project Mind Reader Unit) turned ON.
vijay_k wrote: do I need any special code to read and write .doc file?
No. But you have to make sure that the transferred file is identical to the original one. You may use a tool such a Windiff to verify it.
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 tested it with windiff.
I am getting message that created file is more recent.
I am not getting what can be done next?
Here I am giving You code for writing that file.
if( nFile != NULL )
{
numwritten = fwrite( recvbuf, sizeof(char),length, nFile );
fclose(nFile)
}
else
MessageBox(NULL,"Problem opening file",NULL,NULL);
Do I need to use feof or any other commands?
Thank You...
Vijay.
|
|
|
|
|
vijay_k wrote: I am getting message that created file is more recent.
That's ok.
Now, what about the differences? Can you see any difference (using Windiff, select the first item and then click the expand button)?
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 expanded it and I got some Encrypted language contents.
but on clicking on edit right file and left file I got .txt file version of both files.
There is a differeence in both files.The half of the file is same and I am getting "ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ" charachters for rest of file(in created file).
I am not getting why there is such difference.
Thank You....
Vijay.
|
|
|
|
|
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.
|
|
|
|