|
Yes.I want to scan one file and write it in another
Karteek
|
|
|
|
|
so why not do that right away!?
read all the file to a buffer and write it to the other file using fread, fwrite
or you can use a call like CopyFile(...)
|
|
|
|
|
Doing so one character at a time is the epitome of inefficiency. As has already been suggested, use CopyFile() or SHFileOperation() . Using fread() and fwrite() with a decent sized buffer will also work.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Ok, using a binary editor such as Visual Studio, at what point do the files start to differ? The first character in the 'source' file that does not show up in the 'destination' file will give you a clue.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,
I have a problem with my dialog box which has a richedit control box in it.The dialog box doesnt show up at all.But, if i replace the richedit control box with a edit box, everything works fine..
Can anyone help me,
Thanks
Deepak Samuel
|
|
|
|
|
read vc richedit help, answer is there
includeh10
|
|
|
|
|
Hi,
thanks for the reply, but where do i get that vc rich edit help?
regards
Deepak Samuel
|
|
|
|
|
The rich edit control DLL has not been initialized. If you are using MFC, search MSDN for CRichEditCtrl Overview. It explains exactly what is happening.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Call AfxInitRichEdit(), that should help.
Mickey
|
|
|
|
|
Hi !
I heared about a software called 'v-tune', which let you check where you have memory leaks in your application and in which method the most time is spent.
I'd like to know if there is an equivalent tool, maybe not as powerful as v-tune but which would be free.
Any suggestions ?
Thanks !
Jerome
|
|
|
|
|
If you're using VC 7.x you can try DevPartner Profiler Community Edition http://www.compuware.com/media.asp?cid=3019X36 [^]for profiling. It won't do memory checks though.
It plugs into the VS.NET IDE. (I've not used it though.)
DevPartner Profiler features:
pinpoints performance bottlenecks
profiles managed VB .NET, VC++, C#, JScript 7 and unmanaged VC++
highly accurate results
verify code changes have improved performance
tightly integrated to the VS .NET IDE
supports Visual Studio .NET 2003 and 2002.
Kevin
|
|
|
|
|
This code stolen from the docs on _CrtSetDbgFlag in the MSDN could provide a preliminary leak check for _DEBUG builds.
#include <crtdbg.h>
.
.
.
int tmpDbgFlag;
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR );
tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
tmpDbgFlag |= _CRTDBG_DELAY_FREE_MEM_DF;
tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
_CrtSetDbgFlag(tmpDbgFlag);
.
.
.
On app exit, you should see a dump of any leaks detected. Locating their origin is the next step - not always easy. See the msdn under using the debug heap.
|
|
|
|
|
1) I'm sorry, but I know this is a real newbie-question: how do I make an array for for instance UINT's or doubles, or CButtons?
2) Is there a possibility to determine (fast!) what the highest or lowest value in an UINT- or doubles-array or list is?
I need this, because I've planned to make
1) my very own CHistogramCtrl
2) a (useless) dialog, containing one button, that devides itself into 4 new ones after clicking on it (and so on: click on one of the new buttons and it will start over again).
|
|
|
|
|
DaFrawg wrote:
how do I make an array for for instance UINT's or doubles, or CButtons?
UINT uArray[5];<br />
double dArray[10];<br />
CButton btnArray[3];
DaFrawg wrote:
2) Is there a possibility to determine (fast!) what the highest or lowest value in an UINT- or doubles-array or list is?
The lowest value is always going to be zero. The highest value is always going to be the number of elements minus 1;
int nCount = (sizeof(uArray) / sizeof(UINT)) - 1;
Since you are using MFC, you might want to look at the CArray -related classes.
|
|
|
|
|
DavidCrow wrote:
The lowest value is always going to be zero. The highest value is always going to be the number of elements minus 1
Doesn't he mean the element with the largest value?
Kevin
|
|
|
|
|
I'm not real sure. Even though the word 'value' was used, I took it with a grain of salt. Folks' use of words in these forums vary so much, it's hard to assume anything.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
How much of a beginner are you? Are you a beginner of VC++/MFC only or are you also fairly new to C++?
Apart from David's answer below you could also try using the vector class with the max_element algorithm. If you type "max_element" in the Help index and click on the Sample program link there is an example showing how to use it.
It is also possible to use max_element on a raw array, if you find that easier to get your head round.
double histogram[] = { 1, 4, 4, 6, 1, 2, 2, 3, 1, 6, 6, 6, 5, 7, 5, 4, 4 };<br />
int count = sizeof(histogram) / sizeof(histogram[0]);<br />
double* begin = histogram;<br />
double* end = histogram + count;<br />
double* maximum = max_element(begin, end);<br />
afxDump << "Maximum = " << *maximum << "\n";
You should also "include <algorithm>"
Kevin
|
|
|
|
|
#include <algorithm>
Kevin
|
|
|
|
|
I'm a beginner of VC++/MFC, but I still don't get some C++ basics, like working with 'friend' and 'operator' and arrays, especially when they're declared to be a class member (this isn't good English, is it?).
But if I understand it well, max_element is a macro (or function, whatever) in <algorithm.h>. Is that correct? If it is, it'd really help me.
|
|
|
|
|
Hi all,
usually when i try to handle EN_CHANGE i catch it in my dialog.....
now, i have a class that inherits from CEdit. i want to handle the EN_CHANGE with in that class....
what can i do??
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Have an ON_REFLECT_COMMAND handler in your derived class.
Steve S
|
|
|
|
|
How do I determine if a slider is changed? There is no message for that.
(So, if I fiddle around with a CSliderCtrl, what message or whatever is sent/whatevert?)
|
|
|
|
|
Spin button controls send you a WM_HSCROLL or WM_VSCROLL message. Not sure what a slider does
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
As already said, spin controls send WM_H/VSCROLL messages.
Sliders = Trackbar controls send TB_LINEUP etc.
Look in the Platform SDK under User Interface Services > Windows Common Controls.
OK?
|
|
|
|
|
A spinbutton control sends UDN_DELTAPOS to its parent window when it's spun. lParam is the address of "an NMUPDOWN structure that contains information about the position change" (to quote MSDN).
Sliders send WM_HSCROLL and WM_VSCROLL messages.
|
|
|
|