|
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
|
|
|
|
|
The calls to UpdateData() are not necessary.
You need to put a breakpoint in the two functions and single-step through them using the debugger. That will give you a BIG clue as to what is happening.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
Is there somewhere on the web a description of the functions that hide behind the cryptic decorated function names in the C++ libraries like MSVCP60.DLL?
Searching with Google didn't help much.
|
|
|
|
|
Can you use Dumpbin or Depends?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank you for the help.
I found depends.exe and it helps.
I did not find Dumpbin.exe however.
Is there a site where I can find this utility?
tia
|
|
|
|
|
fledgeling@be wrote: I did not find Dumpbin.exe however.
Where did you look? Mine is located in the C:\Program Files\Microsoft Visual Studio\VC98\Bin folder.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Run Depends on the DLL and use its feature that converts the decorated names to the equivalent prototype.
|
|
|
|
|
Thank you for the quick help.
Found depends.exe v2.2 which helps in clarifying the decorated names.
However, some "decorated" names are not processed : in MSVCP60.DLL the first 219 names are not translated.
Is there a newer version of depends.exe?
|
|
|
|