|
Hi all,
Can anybody please tell me the difference between debug-build and release build....
thanks in advance
|
|
|
|
|
haacked.com/archive/2004/02/14/difference-between-debug-vs-release-build.aspx
http://www.codeguru.com/forum/archive/index.php/t-269905.html
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Debug and Release are for building your project with different configurations.Sometimes you use of Debug mode for debugging your project while Release mode is final build of your program for users.Debug mode contain additional data and symbols to aid debugging but Relase mode optimizations your code without extra debug data.
|
|
|
|
|
See here[^].
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
For example you can use the DEBUG mode to check manually if the code is correctly working, to do this you can use some useful macros as ASSERT () or TRACE ().
During compile of the RELEASE version that lines are jumped.
Russell
|
|
|
|
|
In debug mode, most optimizations are turned off
In debug mode, Str Library allocates more memory than strictly needed and attempts to detect buffer overwrite and stray pointer issues
In debug mode, when thread safety is also enabled, Str Library makes sure that for non-MT-marked objects, only the creator thread attempts modify operations
In debug mode, several unusual conditions that represent programming errors are checked in the code and an ASSERT-ion is thrown if a bad state is detected.
|
|
|
|
|
Is it possible for me to create text-to-speech application for my own language(right to left).
plz help me out the basic steps.
|
|
|
|
|
yah sure,
long back, i have seen somebody using such active X control in vb. i will also try it out.
|
|
|
|
|
Why not?
The 'right to left' mode is only related to the draw function of the control where you put/get the strings.
Then simply you have only to give the strings to the TTS-dll.
Russell
|
|
|
|
|
TanX for reppling!
Sir!
can u tell me wether i'll need phonetic transcription or not.
if yes then plz guide me.
|
|
|
|
|
Sorry, I haven't used TTS before for that problem.
A good example to how start to use the APIs is this[^], and in this site you can find many other example; try to see if someone has developed something for the 'right to left' lenguages.
good luck;)
Russell
|
|
|
|
|
I have some list view that i hold in it item.
I want to change the space between the items in the table and the text - in some cases i want to change it to be with bigger space and in some cases i want to change it to be with no space at all.
How to do it ?
Thanks.
|
|
|
|
|
Hello,
I'm not familiar with the variable-argument lists in C. And I want to
define a function similar to fprintf() and relay the paramater list to
it, I'm using the code similar to the following:
// helper function to direct TRACE output to file
void TraceToFile(const char *format, ...)
{
static FILE *fp;
// ...
va_list(arglist);
va_start(arglist, format);
fprintf(fp, format, arglist);
}
but the result seems to be incorrect. Anybody can help me on this?
Thanks.
Max
|
|
|
|
|
Just replace the fprintf() with vfprintf()
|
|
|
|
|
Thank you very much, Roger Broomfield.
It now works.
My implementation is as this:
in stdafx.h:
#define _TRACE_RELEASE_
#ifndef _DEBUG
#ifdef _TRACE_RELEASE_
#undef TRACE
#define TRACE TraceToFile
#endif
#endif //!_DEBUG
in one cpp file, I add this:
//--------------------------------------------------------
class CTraceFile
{
FILE *fp_;
public:
CTraceFile()
{
fp_ = fopen("c:/Trace.txt", "w");
ASSERT(fp);
}
~CTraceFile() { if(fp_) fclose(fp_); }
FILE *operator()() const { return fp_; }
};
// helper function to direct TRACE output to file
void TraceToFile(const char *format, ...)
{
static CTraceFile tf;
va_list arglist;
va_start(arglist, format);
vfprintf(tf(), format, arglist);
va_end(arglist);
fflush(tf());
}
//========================================================
Then I can view the TRACE output in file c:\Trace.txt for
release build, if macro _TRACE_RELEASE_ is defined.
Thanks.
Max
|
|
|
|
|
I'm looking to maximize my speed while reading a binary file - the file contains a mix of floats & ints(4bytes each) and occasional strings. Floats and ints are converted to the correct endianess post read using bit shifts and masks.
I've fine tuned everything I can think of for reading the file, but have not previously considered changing the interface to the file. I am currently using FILE * with the associated fread, seek etc. functions for no better reason than this being what my original C code used (this entire app is now ported to VC++ with MFC). Is there a faster file reader I should consider? Any speed increase would help, as I am reading 100's of megs of data.
Thanks for any opinions.
|
|
|
|
|
try CreateFile() API
Please chk http://msdn2.microsoft.com/en-US/library/aa363858.aspx
AJay
|
|
|
|
|
As Ajaywinds mentioned, you can get rid of a bit of overhead by using the Windows
file APIs directly, instead of through the ANSI CRT functions. If you must remain ANSI C compliant
this isn't an option.
I would think anything you can do in RAM will help much more. Buffer as much as you can into
RAM before parsing, especially if everything you read will be parsed.
Seeking is costly. If you have to jump all over the place in the file to parse it then performance
will suffer. Design file layout for serial access if possible.
If you can use file I/O APIs, and the format of the files allows it, consider using overlapped I/O.
You can be parsing data in RAM while data is being read from disk.
Just my 2 cents,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Perhaps try using memory mapped files. See here[^] for details.
Steve
|
|
|
|
|
This sounds most promising...
|
|
|
|
|
Try mapping the file to memory. Also if you know the exact layout of the file you could define a struct and cast the pointer directly.
|
|
|
|
|
i have several sliders, i want to save the slider position to a file, and load the position from a file as well. I've never worked with I/O before, i'm quite lost.
here's the code:
<pre>
in the .h file:
int DataBuffer[2];
int nCount;
BOOL CIODlg::OnInitDialog(){
....
// TODO: Add extra initialization here
nCount=2;
}
void CIODlg::OnBnClickedSaveButton()
{
// TODO: Add your control notification handler code here
this->UpdateData();
CFile f;
CString strFilter;
strFilter.Format(_T( "TEXT Files (*.txt)|*.txt|All Files (*.*)|*.*||")) ;
CFileDialog FileDlg(FALSE, _T("*.txt"), NULL, 0, strFilter);
if( FileDlg.DoModal() == IDOK )
{
f.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite);
CArchive ar(&f, CArchive::store);
for(int i=0;i<2;i++)
{
DataBuffer[i]=m_Slider_Data[i].GetPos();
}
ar << nCount;
for(int i=0;i<nCount;i++)
ar<<DataBuffer[i];
ar.Close();
}
else
return;
f.Close();
}
void CIODlg::OnBnClickedOpenButton()
{
// TODO: Add your control notification handler code here
this->UpdateData();
CFile f;
CString strFilter;
strFilter.Format( _T("TEXT Files (*.txt)|*.txt|All Files (*.*)|*.*||" ));
CFileDialog FileDlg(TRUE, _T("*.txt"), NULL, 0, strFilter);
if( FileDlg.DoModal() == IDOK )
{
if( f.Open(FileDlg.GetFileName(), CFile::modeRead) == FALSE )
return;
CArchive ar(&f, CArchive::load);
ar >>nCount;
for(int i=0; i<nCount; i++)
{
ar<<DataBuffer[i];
m_Slider_Data[i].SetPos(DataBuffer[i]);
}
ar.Close();
}
else
return;
f.Close();
this->UpdateData(FALSE);
}</pre>
i got two questions:
1. is .txt a appropriate format for saving slider positions?
2. how come i got a Error trying to open the .txt file? (saving a file is fine, i guess)
<i>CArchive exception: readOnly.
First-chance exception at 0x7c812a5b in IO.exe: Microsoft C++ exception: CArchiveException at memory location 0x0012ef54..</i>
|
|
|
|
|
alberthyc wrote: 1. is .txt a appropriate format for saving slider positions?
That's up to you, but .txt files typically have text in them, while you are storing binary
data.
alberthyc wrote: 2. how come i got a Error trying to open the .txt file?
It looks like you used a wrong operator in CIODlg::OnBnClickedOpenButton():
ar<<DataBuffer[i];
should be
ar>>DataBuffer[i];
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
you can simply use this pseudo code.
//to save the slider positions,
int sliderpositions[3];
for(int i=0;i<3;i++)
sliderpositions[i]=m_Slider_Data[i].GetPos();
FILE *fp;
fp=fopen("filename","wb");
fwrite(sliderpositions,4,3,fp);
fclose(fp);
//to retrieve slider postition
FILE *fp;
fp=fopen("filename","rb");
fread(sliderpositions,4,3,fp);
fclose(fp);
for(int i=0;i<3;i++)
m_Slider_Data[i].SetPos(sliderpositions[i]);
|
|
|
|
|
... you're not quite the sharpest tool in the shed, eh?
modified on Wednesday, December 8, 2010 9:53 AM
|
|
|
|