|
Recursively iterate child directories and files, deleting the files first, and then deleting the empty directories left behind. Use DeleteFile to get rid of the files. See FindFirstFile, FindNextFile, and FindClose. Don't forget to ignore the '.' and '..' files while iterating all files within a directory.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
hai.. this is kiran...
I request all respectd peoples,pl give code or guideline regarding WAVEFILETOTEXT file in either SDK or MFC.
HAPPY VALEN
THANKU FOR ONE AND ALL.
|
|
|
|
|
i don't understand...
how would you convert a wave file (which basically describes a signal) into text file (which is for beeing read)... ?
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
i guess that basically needs speech recognition. when you are able to recognize a speech, then what's the problem converting them to text?
VuNic
|
|
|
|
|
Hi ,
I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class.
I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type).
I m creating my CRecordset class through wizard pointing to database table with ODBC.
CString ppp;
ppp="somevalue"
tstRs->m_res = ppp;
now if ppp is less than 255 it works fine but if its more than 255 characters I get exception .
does anybody know whats wrong ? and how to send a string more than 255 using CRecordset ????
Thanks in advance.
ZINC
|
|
|
|
|
zinc_z wrote: I am having problem sending CString data more than 255 character length to my Database Table through CRecordset class.
I hav tried this thing both on SQL Server field(of type varchar (700) and also on ntext type) and MS Access field(of Text type).
Access tells you right in its design view that a text field can be no larger than 255 characters. See the online specifications here. It's also listed in your ACMAIN11.CHM (or ACMAIN10.CHM) file.
zinc_z wrote: ...I get exception .
What's the exception?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
it gives debug essertion failed at frxdb libraray.
|
|
|
|
|
An MS Access field of type Text is limited to 255 characters. If you want to store more than 255 characters, use a Memo field type.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
I am having the same problem in SQL Server table , where I m using Varchar 700 .
I have tried different fields too , I think its may be the limitation of DoFieldExchange function that It can't send more than 255 characters to DB table ???
Any suggestion ?
|
|
|
|
|
I have an edit box used for user input in my app.
I am able to set the max chars for some of them but others, even though i set it and it shows up in the AFX_DATA_MAP as
DDV_MaxChars(pDX, m_strLastName, 20);
It still allows user to input more than 20 chars without stopping them.
Any ideas anyone?
|
|
|
|
|
why not you use,m_Edit.SetLimitText(20) ?
VuNic
|
|
|
|
|
Where would be the appropriate place to put the setlimittext(20)
In the constructor?
|
|
|
|
|
|
LCI wrote: DDV_MaxChars(pDX, m_strLastName, 20);
This does not "kick in" until the OK button is clicked (which ultimately calls UpdateData() ).
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Once again we are back to the question of how to best terminate a thread. A "regular" thread is easy. A simple boolean variable set to false could terminate a while loop and allow the thread to exit. What happens when a thread is blocked, though? For example, if we had a TCP/IP server and called
m_pSocket->Accept(m_conSocket);
That call will block the thread until a connection is made. What is the best way then to terminate the thread without having to terminate the main thread?
Thanks.
|
|
|
|
|
Well you could use TerminateThread() but that's not recommended. For the TCP/IP server example another solution would be to use a function like select(), with a small time out, to check for incomming connections on the socket and only the call accept() or read() or any other blocking calls. This way the thread will never be blocked for a long time. You could then use a boolean variable to stop it and perform clean up.
|
|
|
|
|
Your asking for trouble even thinking of calling TerminateThread. Here's an example program which shows the kind of thing that can go wrong:
------------------------------------------
#include <windows.h>
CRITICAL_SECTION g_cs;
void ShowMessageBox()
{
EnterCriticalSection(&g_cs);
MessageBox(NULL, "Hello", "ShowMessageBox", MB_OK);
LeaveCriticalSection(&g_cs);
}
DWORD WINAPI ThreadProc(LPVOID lpParameter)
{
ShowMessageBox();
return 0;
}
int main(int argc, char* argv[])
{
InitializeCriticalSection(&g_cs);
// Start thread.
DWORD ThreadID;
HANDLE hThread = CreateThread(NULL, 0, &ThreadProc, 0, 0, &ThreadID);
// Wait for one second then kill the thread.
// It still holds the CRITICAL_SECTION!!!
Sleep(1000);
TerminateThread(hThread, 0);
// We've killed the "ShowMessageBox" API, permanently, calling it now
// causes this thread to dead lock!
ShowMessageBox();
DeleteCriticalSection(&g_cs);
return 0;
}
------------------------------------------
In this program calling TerminateThread permanently breaks ShowMessageBox because we killed the thread when it still held a lock. This is the worst kind of bug as it's very hard to reproduce as it's sensitive to timing. If you're calling Win32 functions many of them will briefly hold locks, if you terminate a thread while it is hold such a lock you're screwed.
Moral: Don't call TerminateThread. There are exceptions but very few.
Steve
|
|
|
|
|
masnu wrote: A simple boolean variable set to false could terminate a while loop and allow the thread to exit.
Be sure you have not instructed the compiler to ignore testing the boolean with each iteration of the loop. Use of volatile will help here.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
|
Hi,
I have got a query related to 'Unicode to MBCS conversions'.
First of all a brief information about project. I have got 2 projects, 1 is Unicode (Non-ISAPI) and other Non - Unicode (ISAPI). I need to pass the values from project 1 to project 2. Then this is going to be sent to ISAPI which in turn display the value in the browser through ASP page. I am using pseudo resources in which some characters are visible correctly while some are not. This output in the browser is through ISAPI calls written in project 2. My aim is to see the output in the browser correctly.
I m getting Output as follows:
?eí?í†íàlí$e
????àr†er ?à$ reí?í†íàlí$ed ??.
?lí?? here †? re†?r? †? †?e ????àr†er ???e ?à?e.
Following code snippet is written in project 1:
In order to convert Unicode strings to MBCS following conversion is done.
char* mbcsBuff = (char*) malloc ((strMessage.GetLength() + 1) * sizeof(_TCHAR));
wcstombs( mbcsBuff, strMessage, (strMessage.GetLength() + 1) * sizeof(_TCHAR));
mbcsBuff needs to be passed to project 2 in the form of BSTR.
Project 2: BSTR string from project 1 is then converted to CString here and passed to ISAPI call (StartContent(), EndContent()) and sent to browser.
Now how do i see the output correctly?
I have tried my level best to put up the problem clearly, even then feel free to ask me more details if needed. Urgent support is needed. Thank you in advance.
Nishith
|
|
|
|
|
Take a look at the function WideCharToMultiByte . This converts strings from unicode to MBCS.
Deus caritas est
|
|
|
|
|
Is the Unicode string coming out correctly? Also, which code page do you want to use to convert the Unicode string to MBCS? Also BSTRs are Unicode strings prefixed by length, so why not create a BSTR from the output of project 1 from the Unicode string? You can then pass this BSTR to project 2 and then convert to MBCS.
Deus caritas est
|
|
|
|
|
Is the Unicode string coming out correctly? Also, which code page do you want to use to convert the Unicode string to MBCS? Also BSTRs are Unicode strings prefixed by length, so why not create a BSTR from the output of project 1 from the Unicode string? You can then pass this BSTR to project 2 and then convert to MBCS.
Deus caritas est
|
|
|
|
|
Hi Andy,
Yes Unicode string is correct in project 1. I have used code page as 1200 for conversions. Is it possible to convert BSTR string into MBCS in a Non-Unicode project? Since project 2 is having ISAPI calls where exactly i need to pass on this MBCS string, i tried doing the same but the result was the same (No change in the outout).
Also i have tried WideCharToMultiByte() but the result is the same.
One more point project 2 cannot be made as Unicode project since ISAPI calls are used to pass on the strings to the browser.
Can you throw some more light on this issue? Thank you for your time.
Nishith
|
|
|
|
|
meet2nishith wrote: Yes Unicode string is correct in project 1. I have used code page as 1200 for conversions. Is it possible to convert BSTR string into MBCS in a Non-Unicode project?
try _bstr_t class it expose char* for non Unicode projects
"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
|
|
|
|