|
How to open a file Sir? I tried double clicking on it in order to open it .
It's very very urgent...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
open your window, take your file, throw it through the window.
now it is opened...
|
|
|
|
|
lol
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
courtesy tox courtesy... ask file to leave by door instead of window!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Oh sure, but now there is a mess all over the sidewalk. What if the file's contents happen to be hazardous? Then the EPA would have to get involved.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Well Spoken
Bram van Kampen
|
|
|
|
|
Use CreateFile() to open file and get the handle. Well, for your case the following code snippet will help.
HANDLE hFile = CreateFile( _T("c:\\MyFile"),
GENERIC_READ,
FILE_SHARE_READ,
0,
OPEN_EXISTING,
0,
0 );
It will open the file if exists, or else return INVALID_HANDLE_VALUE on failure.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Currently working on project that needs to convert the existing lagacy application(written about 15 Years ago) into Vista Compatible.
I am really getting struck up in some areas. I would like to know how to identify createevent,createsemaphore apis are creating the respective synchronization objects in global namespace.
Thanks,
Venkat
|
|
|
|
|
I'm not sure what you're asking, but I believe
the session namespace is used unless you explicitly
specify global.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello everybody,
is it possible to freeze the whole screen output?
So that all windows are freezed in output whatever happens.
I want to use it to prevent multiple drawing of a modal-dialog into my MDI-Application.
( the modal-dialog closes on F3-Key and reopens after a certain work is done it should look like the dialog has never been closed after pressing the F3-Key )
Big thanks for any help
|
|
|
|
|
|
Thanks for your answer, but it doesn't work.
The modal-Dialog still disappears for a moment and reappears.
If i could freeze the entire Screen, propably directly "the main output device of windows"
So i'm sure that no flickering happens.
The resolution would also resolve some other ugly side-effects during display.
Thanks anyway
|
|
|
|
|
|
It resolves not this problem, because after a SetRedraw(FALSE) to GetDesktopWindow the animation of the closing dialog is still drawed (propably only under Vista (because it's a animation))
BUT
It resolves a problem which i try already since over 6 months to resolve.
SO : BIG BIG THANKS
|
|
|
|
|
|
What about ShowWindow(SW_HIDE);
Bram van Kampen
|
|
|
|
|
Sorry, but i don't understand your answer.
If i would insert a ShowWindow(SW_HIDE); i have also a flickering.
Because the dialog disappears and reappears.
Thanks anyway
|
|
|
|
|
You said:
( the modal-dialog closes on F3-Key and reopens after a certain work is done it should look like the dialog has never been closed after pressing the F3-Key )
I take it you mean a non-modal Dialog.
Instead of Opening on an event, and Closing with F3, Hide and Unhide the dialog instead. It has the same visual effect as opening and closing, with an awfull lot less overhead. By the way, I take it that your program is single threaded. In that case, no work of any kind is carried out in the other windows while the thread is stuck processing messages in your dialog.(i.e. when your Dialog has the focus).
Bram van Kampen
|
|
|
|
|
Hello Everybody
I am opening a file and reading file till end of file and then close that file and again opening the same file but while reading it goes to EOF so i am not able to read that file again.
can anyboy tell what could be the Problem and how can i read the file again.
Thanks in advance
RYK
|
|
|
|
|
|
If you are using the same file object to read the file again, you need to seek the file pointer to beginning of file(BOF), before you read. This is so because you have read to End of File, and when you read again, it tries to read from current position of file pointer. You need to reset the current position to BOF.
I dont know what language are u using but it would be something like
file.Seek(0);
or
filestream.SeekBegin();
or something similar.
Regards,
Its never over !
|
|
|
|
|
shaibee wrote: If you are using the same file object to read the file again, you need to seek the file pointer to beginning of file(BOF), before you read.
The OP said the file was closed before attempting to open and read from it again.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
If you are reading something other than a text file (say, mp3 or mpeg), there can be multiple EOF in the same file. So it is a better idea to first calculate the size of the file and then read byte by byte.
Shibu
|
|
|
|
|
Use a seek function. If you opened with fopen(...) you use
fseek(F,0,SEEK_SET) to rewind it to the beginning.
Bram van Kampen
|
|
|
|
|
hi, all
code is,
----------------------------
CDialog * dlg;
while(TRUE)
{
dlg = new MyDialog;
dlg->Create(IDD_DIALOG, this);
Sleep(500);
dlg->DestroyWindow();
Sleep(500);
}
----------------------------
MyDialog is CDialog subcalssing,
MyDialog virtual method override PostNcDestroy()
void MyDialog::PostNcDestroy()
{
delete this;
CDialog::PostNcDestroy();
}
----------------
this code do not always memory leak.
but some time increase using memory. for 4kb... and not decrease using memory
What is problem??
|
|
|
|