|
To concatenate the two strings, you could use something like this:
LPCWSTR lpPath1=L"c:\\temp\\folder1\\";
LPCWSTR lpPath2=L"testing\\tester";
std::basic_string<WCHAR> strPath = lpPath1;
strPath += lpPath2;
RemoveDirectoryW(strPath.c_str());
This requires a #include <string> . Note that I'd recommend generic text mappings (with _T , etc.) instead of just using Unicode directly.
|
|
|
|
|
Thanks for ur support....
May i know how to achieve this if lpPath1 is a Cstring.....
|
|
|
|
|
CString strPath1 = _T("c:\\temp\\folder1\\");
CString strPath2 = _T("testing\\tester");
CString strPath = strPath1 + strPath2;
RemoveDirectory(strPath);
|
|
|
|
|
Sorry i mean to say if only lpPath1 is Cstring and lpPath2 is LPCWSTR then how can i add them and pass to RemoveDirectoryW() Please let me know.....
|
|
|
|
|
If you're compiling in Unicode mode, it's basically just the same:
CString strPath1 = _T("c:\\temp\\folder1\\");
LPCWSTR lpPath2 = L"testing\\tester";
CString strPath = strPath1 + lpPath2;
RemoveDirectoryW(strPath);
|
|
|
|
|
Hi,
sorry it"s deleting thanks.....
modified on Saturday, March 21, 2009 9:59 AM
|
|
|
|
|
Hi,
How can i get the value of Environment variables(user variables)..thru a sample ....
Please help me out....
|
|
|
|
|
TCHAR varValue[32767];
GetEnvironmentVariable(_T("PATH"), varValue, 32767);<pre>
<code>varValue</code> will (after the call) contain the path for your account.
<div class="ForumSig">Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p</div>
|
|
|
|
|
Thanks for ur reply...suppose using this...
TCHAR varValue[32767];
GetEnvironmentVariable(_T("TEMP"), varValue, 32767);
if get the path of TEMP in varValue...how can i create a folder named "Testing" under that TEMP folder...using CreateDirectoryW()
|
|
|
|
|
Here is another way to do it...
CString directory = "";
directory = getenv ( "ProgramFiles");
CString newDirectory(directory + "\\EnvFolder" );
BOOL createDirEnv = CreateDirectory(newDirectory, NULL);
|
|
|
|
|
wchar_t varValue[32767];
GetEnvironmentVariableW(L"TEMP", varValue, 32767);
wchar_t testingDir[32767];
PathCombineW(testingDir, varValue, "Testing");
CreateDirectoryW(testingDir, 0);
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I am writing an application, which required unicode conversion, but I am facing some problem with SLOVAK characters.
For example, I face the problem for character ď , whose value is ď
for conversion, I did the following:
string strNum = "271";
wchar_t lpszUcode[1];
lpszUcode[0] = atoi(strNum.c_str());
int nCodePage = 1252;
int iBuffLen = WideCharToMultiByte(nCodePage, NULL, lpszUcode, 1, NULL, 0, NULL, NULL);
char* buffer = new char[iBuffLen + 1];
WideCharToMultiByte(nCodePage, NULL, lpszUcode, 1, buffer, iBuffLen, NULL, NULL);
buffer[iBuffLen] = 0;
string strRes = buffer;
It returns with the value d rather than ď .
can somene pl. sugeeset the solution for this.
Regards
Tough Time Never last, but Tough People do.
|
|
|
|
|
Vineet Kumar wrote: int nCodePage = 1252;
Code page 1252 doesn't contain that character, so it translates to the nearest equivalent that is in hte code page - which is "d".
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi All,
I need some details about File and Directory choosers. my requirement is i need to display the folders with content(ie. Folder is "Sample" it has sam.txt) in particular directory. I should use drag & drop , delete and multiple selection(not folder only content) events. So which control is better for this? Tree control or List Box or anything else?
Please help me..............
Thanks & Regards,
Anitha
|
|
|
|
|
AnithaSubramani wrote: Very urgent.............................
AnithaSubramani wrote: So which control is better for this? Tree control or List Box or anything else?
Good coding.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
Please let me know how to use RegQueryValueExW() with sample ....im confused with unicode..
|
|
|
|
|
The MSDN page for RegQueryValueEx[^] has an example. Where is your problem?
Why is that you have to worry about Unicode or ANSI? Can't you just use generic text-mappings?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Still busy though, managing to take some time out to see what's going on at CP.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
see here[^]
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi Forum
How can i call function in thread.Situation is application make backup of moveing files/folder.And path is came one by one.So i try to use Thread.But i stop here(threading).Create a thread i use this code
CWinThread *co= new CWinThread();
co->CreateThread();
But How can i pass Copy Funtion in thread.Copy function is Copy(source path,Destination path)
Plz help me
|
|
|
|
|
If the "Copy" function is a global function, then you could call it straight from within your thread. If it is a member function of a class, then construct a class object and pass it to the thread as a parameter when you create your thread.
Also, read up on thread synchronization.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks for reply
Now study more about Thread and do something like this.
void ThreadProc(void *param)
{
Copy(Source,Destination);
}
{
void CTestDlg::PathCame(const CString & FilePath)
{
HANDLE handle;
handle = (HANDLE) _beginthread( ThreadProc,0,0);
WaitForSingleObject(handle,INFINITE);
}
But only one thread run at the time.When fist thread is working and second is come then first thread destroy.
Plz help me
|
|
|
|
|
First things first: If you use things like _beginthread (or even CreateThread) along with MFC, all bets are off.
You must use the MFC functions instead. Like - to begin a thread, use AfxBeginThread()[^].
Have a look at the remarks section of CWinThread[^].
Can you tell me what is that you are looking to build? I don't get it.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
im using UrlDownload to file....to download a file from server..it worked fine before...but now it"s not working the reason i guess may be we have changed settings in internet options..ie related to ActiveX..but even when i reset the settings it"s not able to download file......(If possible please suggest any other API which cannot be dependent on internet settings...)
URLDownloadToFile(NULL,"http://(servername)/(virtualdirectory name)/(filename) , (path to store downloaded file), 0, NULL)
Please help me regarding the same......
|
|
|
|