|
code is :
int main()
{
char khat[1000];
clrscr();
int i;
for(i=0;i<1000;i++) {khat[i]='\0'; if(i<100)counter[i]=0;}
FILE *f;
f=fopen("falle//in2.htm","r");
for(i=1;i<1000;i++)
{
fgets(khat,1000,f);
printf("%s\n",khat);
if(strcmp(khat,"</HTML>")==0) break;
}
fclose(f);
char ch=getch();
if(ch==27) return 0;
return 0;
}
and file is :
<HTML>
<BODY>
<#if( 1+2^3 < 2*(2+3)+1-1+1-1+1-1+1-1+1-1+1-1+1-1+1-1+1-1+1-1+1-1 )#>
correct
yes , it is correct
<#fi#>
incorect
<#loop 4#>
this is in the loop
and number is :
<#i#>
<#do#>
</BODY>
</HTML>
|
|
|
|
|
I think you should provide the entire fragment between the line where you open the file (fopen ) and close it (fclose ), and may be a precise content of input file. Perhaps, someone will figure out the problem.
If your program is too big, try to remove (comment) some fragments, keeping file-processing only. Thus you should be able to reproduce the problem for a smaller program.
|
|
|
|
|
How are you verifying the contents of string ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi all,
I have a video player that plays video files(.cam).Everthing is working fine.I can even able to extract audio and save it as .wav file.
This is the code where i record audio .
DWORD CWave::recordWAVEFile(DWORD dwMilliSeconds) <br />
{ <br />
UINT wDeviceID; <br />
DWORD dwReturn; <br />
MCI_OPEN_PARMS mciOpenParms; <br />
MCI_RECORD_PARMS mciRecordParms; <br />
MCI_SAVE_PARMS mciSaveParms; <br />
MCI_PLAY_PARMS mciPlayParms; <br />
<br />
mciOpenParms.lpstrDeviceType = "waveaudio"; <br />
mciOpenParms.lpstrElementName = ""; <br />
if (dwReturn = mciSendCommand(0, MCI_OPEN, <br />
MCI_OPEN_ELEMENT | MCI_OPEN_TYPE, <br />
(DWORD)(LPVOID) &mciOpenParms)) <br />
{ <br />
return (dwReturn); <br />
} <br />
<br />
wDeviceID = mciOpenParms.wDeviceID; <br />
<br />
mciRecordParms.dwTo = dwMilliSeconds; <br />
if (dwReturn = mciSendCommand(wDeviceID, MCI_RECORD, <br />
MCI_TO | MCI_WAIT, (DWORD)(LPVOID) &mciRecordParms)) <br />
{ <br />
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL); <br />
return (dwReturn); <br />
} <br />
<br />
<br />
if (MessageBox(hMainWnd, "Do you want to save this recording?", <br />
"", MB_YESNO) == IDNO) <br />
{ <br />
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL); <br />
return (0L); <br />
} <br />
<br />
mciSaveParms.lpfilename = "c:\\file.wav"; <br />
if (dwReturn = mciSendCommand(wDeviceID, MCI_SAVE, <br />
MCI_SAVE_FILE | MCI_WAIT, (DWORD)(LPVOID) &mciSaveParms)) <br />
{ <br />
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL); <br />
return (dwReturn); <br />
} <br />
return (0L); <br />
}
But my problem,it takes more time to record and not allowing to play the video.
(recording is done at first)
Can I do recording the audio and playing video simultaneously..
help me please..
cheers
sangeet
|
|
|
|
|
If the save is a lenghty operation, then you can simply start a new thread in which you will do the saving.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Greetings:
I am writing an MFC app with VS 2003. I am trying to track a memory leak. I have replaced all of my "new" keywords with "DEBUG_NEW" as per the Microsoft documentation on tracking MFC memory leaks.
All of my files contain the:
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
lines at the top and I am building in _DEBUG mode.
The compiler is issuing "identifier not found" for all instances of "DEBUG_NEW".
Does anybody know what the problem is?
Thanks in advance,
Mark
|
|
|
|
|
wrote: I am writing an MFC app with VS 2003. I am trying to track a memory leak. I have replaced all of my "new" keywords with "DEBUG_NEW" as per the Microsoft documentation on tracking MFC memory leaks.
All of my files contain the:
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
lines at the top and I am building in _DEBUG mode.
The compiler is issuing "identifier not found" for all instances of "DEBUG_NEW".
Does anybody know what the problem is?
Are you using precompiled headers??
if not then try including "Afx.h" file which contains the definition related to DEBUG_NEW macro.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi, thanks for your response.
Yes, I am using pre-compiled headers and I also added the include of "afx.h" to the top of all of my files, just for good measure. I am still getting the same result...
Bizarre...
|
|
|
|
|
|
I think you only need to add the definition for new , but you do not have to replace any appearance of your new operators with DEBUG_NEW .
|
|
|
|
|
You know, I think you're right. I misunderstood the documentation.
So that means that the memory dump data that I am getting in my output window is as good as it gets? Its not very helpful...
Oh, well...
Thanks for your help.
Mark
|
|
|
|
|
Hello
I want to open a file in binary mode in Turbo C++ , by using fopen()
and i need help
thank you
|
|
|
|
|
V_shr wrote: I want to open a file in binary mode in Turbo C++ , by using fopen()
What are you trying to do ? Could you be more specific ?
If you want to 'open the file in binary mode', you can simply add the flag "b" when calling fopen. But I doubt this is what you are looking for.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
do you mean that i can write :
fopen(adress,"br");
??
|
|
|
|
|
V_shr wrote: do you mean that i can write :
fopen(adress,"br");
Yes but what is adress ? It should be a char array that contains the path to the file.
But you didn't answer my question: what are you trying to do exactly ? I think binary mode is not what you think it is.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
|
Try
FILE * file = fopen(file_name, "rb");
The key issue is the "b" flag.
|
|
|
|
|
hi friends,
i dnot any thing of logger thread. i want capture diff. type exceptions and logger file cacth exceptions and put into one files.
pls Guide
satya
|
|
|
|
|
bujji_bec wrote: i want capture diff. type exceptions and logger file cacth exceptions and put into one files.
create a Out process logger exe and insert your loggig message there!@
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
can i know how to store a date format dd-mm-yyyy as in mfc in to
mysql table in the format yyyy-mm-dd send code plz
hi
|
|
|
|
|
<br />
CString m_cdate;<br />
SYSTEMTIME sysTime;<br />
GetSystemTime (&sysTime);<br />
<br />
m_cdate.Format("%04d-%02d-%02d", sysTime.wYear, sysTime.wMonth, sysTime.wDay);
Now write it to the table
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 9:42 Tuesday 6th June, 2006
|
|
|
|
|
yar this will give problem that GetYear(),GetMonth(), GetDay() are not member of SYSTEMTIME if ucan find solution mail me at gourav_d1983@indiatimes.com
hi
|
|
|
|
|
Use this code //
<br />
<br />
SYSTEMTIME sysTime;<br />
GetSystemTime(&sysTime);<br />
CString s;<br />
s.Format("%04d/%02d/%02d",sysTime.wYear ,sysTime.wMonth,sysTime.wDay);<br />
AfxMessageBox (s);<br />
<br />
Does this work ........
It will................
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 9:37 Tuesday 6th June, 2006
|
|
|
|
|
I tried and tested the code on my machine and it runs well producing the desired output.
Any ways you can try using CTime as Laxman suggested or use COleDateTime
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|