|
hi to all
i created a directory and want to change the location of that directory on a button click how is this possible
plz reply soon
|
|
|
|
|
You can use MoveFile API[^]
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
first of all thank you for reply.My actual problem to moving directory, I am able to move file but how can i move directory
Plz reply
|
|
|
|
|
Do you read the documentation link?
It states:
Moves an existing file or a directory, including its children.
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.
[my articles]
|
|
|
|
|
ok thank you i have done it
|
|
|
|
|
|
Do you need to SetCurrentDirectory?
|
|
|
|
|
Hi , I am using .dll file of another company. they provide me the sample
that use LoadLibary method .but I do not want to use LoadLibrary Method. they also do not provide be import library . so can any one tell me how
to generate a import library from the .dll file
Trioum
|
|
|
|
|
|
I got the same solution before i read your reply. By the thanks indeed for your generosity.
But actually i wanted to know about using CArchive with CFile.
Regards,
Hemang
|
|
|
|
|
Hi,
What are the methods to skin the systray clock?
Thank you
|
|
|
|
|
Hello all,
I have used CFile for writing. I want the same to be opened in appending mode. i.e. i want to add some contents more to it. I know little that this might be done with CArchive bu don't know how to use it. or is there any other alternative in CFile to do so?
Regards,
Hemang
|
|
|
|
|
Hemang Raval wrote: I have used CFile for writing. I want the same to be opened in appending mode. i.e. i want to add some contents more to it.
To add content, simply call CFile::SeekToEnd and then write.
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.
[my articles]
|
|
|
|
|
When processing the above message in DllMain
would GetCurrentThreadId get the ID of the Newly created Thread
|
|
|
|
|
It should, form MSDN http://msdn2.microsoft.com/en-us/library/ms682583.aspx[^]:
The current process is creating a new thread. When this occurs, the system calls the entry-point function of all DLLs currently attached to the process. The call is made in the context of the new thread.
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.
[my articles]
|
|
|
|
|
Thankx from this I could probably figure out who is calling me
|
|
|
|
|
Does anyone know if you can use Cfile::typeText in a "text file" only File? I've seen eamples of Stdiofile and Memfile but no examples of a simple textfile.
A C++ programming language novice, but striving to learn
|
|
|
|
|
I'm not sure what you're asking. A CStdioFile opened in
CFile::typeText mode would be for working with text files, right?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm asking the wrong question I guess.Must you have a class "CStdioFile" in order to use CFile::typeText.
Here's my code:
TCHAR szBuffer[512];
UINT nActual = 0;
csFileName = "C:\\Shop Maintenance System\\REPORT FORMS\\TruckMaint.txt";
HANDLE hFile = CreateFile(_T(/*"CFile_File.dat"*/csFileName),
GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
AfxMessageBox(_T("Couldn't create the file!"),MB_OK|MB_ICONEXCLAMATION);
}
else
{
// Attach a CFile object to the handle we have.
CFile m_fle(hFile);
//static const TCHAR sz[] = _T("I love CFile!");
m_fle.SetFilePath(csFileName);
// write string
//m_fle.Write(sz, sizeof(sz)); //Write( szBuffer, sizeof( szBuffer ) );
//m_fle.Write( szBuffer, sizeof( szBuffer ) );
m_fle.Seek( 0, CFile::begin );
nActual = m_fle.Read( szBuffer, sizeof( szBuffer ) );
// We can call Close() explicitly, but the destructor would have
// also closed the file for us. Note that there's no need to
// call the CloseHandle() on the handle returned by the API because
// MFC will close it for us.
m_fle.Close();
What the buffer contains is a bunch oontains is a bunch of "ffffffffffffffffffffffffffff...." so I think it's not giving me the text that I know is in the file. How do I get the text with the carrage returns, etc.?
A C++ programming language novice, but striving to learn
|
|
|
|
|
Larry Mills Sr wrote: Must you have a class "CStdioFile" in order to use CFile::typeText
Yes, or some other CFile-derived class that supports the flag.
The docs specifically state the flag is for CFile-derived classes.
If you try to use it with a straight CFile, it will assert.
If you want to use the CreateFile()/CFile method as shown, you'll need
to parse the file as text yourself.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Could you explain what you mean, exactly, by "you'll need
to parse the file as text yourself.". I have no idea what you mean.
Please excuse my ignorance.
A C++ programming language novice, but striving to learn
|
|
|
|
|
If you use CStdioFile , you can read the file line-by-line. With CFile , you read the file in chunks, which may (not) cross line boundaries.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
In addition to DavidCrow's reply...
The file will be opened in binary mode. That means you just
read or write bytes. These bytes can be anything. If you
choose to treat them as text, then you'll have to parse for whitespace,
line endings, and/or whatever else. The framework will give you no
built-in help for treating the file contents as text.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have asked this question before and were given some good answers. The problem is I am a beginner. I have no idea of where to get started. So when I am told about coordinates and bitmaps I am lost. I have written a C++ program. I can run it now by clicking on the default blue and white box. I want to have like a nice Box with the name of the program written on it. When you click on the box the program runs. Are there books on how to do this? Can someone give me some advice for dummies? If you are unsure of what i am asking let me know.
Thank You and have a Merry Christmas and Happy New Year
|
|
|
|
|
Did you search on the codeproject?
|
|
|
|