|
zahid_ash wrote: how can I make a copy of file on another location while it is open
simply read the whole file and create the new file and write the data into it.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
OK,
copying a file while it is open means A "AA.doc" file is open in MS Word . and at the same time my application wants to copy it on another location.
would the simple read and write to other location works. i thought that may be the document is locked.
Regards.
|
|
|
|
|
zahid_ash wrote: would the simple read and write to other location works. i thought that may be the document is locked.
I have tried the demo, but the MS Word not allows this operation .
i think it opens the file in Exclusive read/write mode so that no one can access the file.
may have to set the some permissions
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
You can open the file in the read/write or the append mode.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I think you can use ::SHFileOperation to copy openned files.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
would there be a difference between simple read and write . and using ::SHFileOperation()
Regards.
|
|
|
|
|
Notice that you said "my app" but you said nothing about Word. It would help others to help you to mention details such as the fact that the data is a Word file. You would get better answers that way.
I would use the Word objects to copy the data. That is, the objects used by VBA. I am not sure that will work but I would be very, very surprised if it is not possible.
|
|
|
|
|
Hi !!!
If you use the functions of the WIN32API for the copying the files, ... you don't have to close the opened file, it does it self.
By !!!
-:KNOX:-
|
|
|
|
|
Hi Guys,
This is a question asked by one of my junior.
Though i could able 2 answer him,by telling him to ensure different memory location for each instance of the class,the size is set as 1.
But I am(ofcourse he tooo) not convinced with my answer.
Can anyone of u give me a good explanation for this Question??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
When you create the object of the class then the for the existence of the object there should be atleast memory so it is is 1 byte even the class dont having single variable
and if the class contains atleast one virtual function then size is 2 bytes
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
A_Laxmanif the class contains atleast one virtual function then size is 2 bytes
r u sure about it ??
If it contains a virtual function ,then its size should be either 4(since the memory location will be 4 bytes long) or 5(4+1) bytes ..How can it be 2 bytes.
I am confused.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
NiceNaidu wrote: I am confused.
don't be confused.
In case of 16 bit applications(DOS)
the size of class when virtual function present is 2 bytes
In case of 32 bit application(Windows)
the size of class when virtual function present is 4 bytes
In case of empty class for both cases it is 1 byte
Knock out 't' from can't,
You can if you think you can
-- modified at 8:24 Friday 19th May, 2006
|
|
|
|
|
NiceNaidu wrote: ...to ensure different memory location for each instance of the class...
This is the answer. What else are you looking for?
FAQ[^]
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Hi,
I have a dialog window in which user has to enter some text in the IDC_WORD after clicking on search button i want the value to be stored in a variable line,
I have created a variable m_WORD of CString type ,
CString line;
line = m_WORD;
char * w =(char *) (LPCTSTR) line;
word = w;
but the value is not getting stored in line I used F5 and checked value of m_WORD is empty "" what will be cause ..?? can anyone help me with this….
Regards,
Vinay Charan.
|
|
|
|
|
Use UpdateData(TRUE) before line = m_WORD
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
vinaycool wrote: CString line;
line = m_WORD;
char * w =(char *) (LPCTSTR) line;
char * str=new char[MAX];
UpdateData();
lstrcpy(str,m_test.GetBuffer(m_test.GetLength()));
The code copies the data from the edit box into the str variable.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
A_Laxman wrote: vinaycool wrote: CString line;line = m_WORD;char * w =(char *) (LPCTSTR) line;
nope this code will also work well, have a try!
"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
|
|
|
|
|
ThatsAlok wrote: nope this code will also work well, have a try!
Yes buddy,
I have tried the code and works fine.
as well tried another to do same and posted in my previous post.;P
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
vinaycool wrote: I have created a variable m_WORD of CString type ,
Have you called GetWindowText in that Function or UpdateData(FALSE) !
"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
|
|
|
|
|
Use:
GetDlgItem(IDC_WORD)->GetWindowText(m_WORD);
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
use UpDateData then
m_youret.GetWindowText( m_WORD);
whitesky
|
|
|
|
|
There is another way to do it
- Assign a "Control" variable to your edit box (CEdit m_textEdit).
- Use the method
GetWindowText() for retrieving the results
void CDemo::OnBnClickedSearchButton()
{
...
CString userResponseText;
m_textEdit.GetWindowText(userResponseText);
...
}
Here you don't need to worry about UpdateData that usually has side effects.
Just wanted to give you another way to do it.
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
Hi all
I have a project, created in VS2005.
When I enter its directory, inside I have 2 files and 3 folders : Debug, MyProject, Release, MyProject.ncb, MyProject.sln
Strange is that MyProject.ncb is 16 MB in size.
And other files(folders), together are only 4 MB(If I clear the debug and release folders).
Strange is also that MyProject.pch file is 12MB, when Debug folders of my project is not empty.
Why are these files so large ?
Size of total source files I use is only 3MB.
Thank you.
|
|
|
|
|
NCB is the Intellisense Database. This sometimes messes up BADLY. I have had a NCB-File with a size of 1.2 GB (!!!). Sometimes the Parser will get a hick-up and go crazy. Just delete the file, it's automatically recreated when you reload your project. Looking stuff up (code completion etc.) might be a bit slow, but will soon get back to its old self.
The PCH-File is the precompiled header file. You can delete that one as well, it also will be recreated. If it is not there, compiling might take a bit longer (because it has to be recreated).
If you do not need recompiled headers, turn them off in the project properties.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Hello everyone,
i am working in c++.
is it possible to use strlog.h in win32 console application.
if so where can i find the file and the documentation for using it.
thanks in advance,
regs
vijay
|
|
|
|