|
I can create files manually via windows explorer, so unless there is a separate security issue that only affects files created through my app I don't know why it would be a problem.
I took the modes out of the fstream as the other reply indicated that they weren't needed but it didn't work with the ::in or ::out flags specified either
I got it to do something by adding this
fstream newFile;
CFileDialog fileBrowser(FALSE,".txt",NULL,OFN_OVERWRITEPROMPT,"Geske Energy Data Files (*.dat)|*.dat|",NULL);
int ret = fileBrowser.DoModal();
newFile.open (fileBrowser.GetFileName());
// WriteHeader
newFile<<'!'<<"hjhjh"<
|
|
|
|
|
ldsdbomber wrote: I took the modes out of the fstream as the other reply indicated that they weren't needed but it didn't work with the ::in or ::out flags specified either
I've got an older version of the STL, and it shows that fstream::open() has no default mode -- a mode must be supplied. That apparently is not the case with you or you would have received a compiler error. An ostream object, however, defaults to out .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanks. the problem is I want to create a new file only if it doesn't exist and I can't get that to work. Unless I am being an idiot, the flag I need is ios::nocreate and this can be ORed in with the out flag
i.e.
FileDataStream.open(fileName, ofstream::out | ios::nocreate);
but when i do this, it is still making the file even when it doesn't exist. I don't know why one flag is ofstream and the other is ios, but ofstream::nocreate didn't seem to work.
Maybe I am just getting in a pickle with this, but I couldn't find a useful example that I could follow along, surely "open file for appending, unless it's not there in which case make a new one and write to it" must be a very commonly done thing!
|
|
|
|
|
Hopefully a simple question.
At design time what are the units of the measurements at the bottom left of the screen? Basically at present I want a dialog that fills the entire width of the screen (1600x1200), I can set up and populate this at runtime but would prefer to do it at design time.
cheers,
Andy
|
|
|
|
|
I assume you are talking about DLU ( Dialog Logical Unit ).
google about them.
|
|
|
|
|
Hope I understood your question
Do you need to Width and height of the screen does GetSystemMetrics(SM_CXSCREEN/SM_CYSCREEN); your answer?
|
|
|
|
|
open your dialog in resource editor and check for property "maximize"
|
|
|
|
|
mcsherry wrote: Basically I want a dialog that fills the entire width of the screen (1600x1200), I can set up and populate this at runtime but would prefer to do it at design time.
This is almost assuredly going to fail. If you want a full-screen dialog, do it at runtime. Then it will work on any system, at any resolution, using any font. Otherwise, the only system that it is guaranteed to work on is the one you designed it on.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hello!!!
when i protect file ....the preview of a file should be displayed ...means
file should be played or displayed in a rectangle displayed on window while protecting
|
|
|
|
|
What do you mean by protecting and what do you mean by displaying the file ? And what do you mean by preview ?
Which kind of files ?
|
|
|
|
|
Ahmm... but here is there no one with telepathy??? :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Nelek wrote: Ahmm... but here is there no one with telepathy???
Yes, but not on days that end in 'y'.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: but not on days that end in 'y'
Why?
|
|
|
|
|
Nelek wrote: but here is there no one with telepathy???
Hah! I knew you were going to say that!
Oh wait, thats psychic powers...
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
More explain will be helpfuls.
|
|
|
|
|
Hi Friends
I want to know how i get ID of common controls used in project.I am using CFileOpen class for Open file dialog file. I want ID's of each control used on that common controls such as static text "Look in", "File of Type" etc. I want to know these ID because by using these ID i want to change font of common controls.
Thanks in Advance
Atul
|
|
|
|
|
Take a look in the path: .\Microsoft Visual Studio\VC98\MFC\SRC
Files: DLGFILE.cpp, DOCMGR.cpp, PPGPICT.cpp
One is its implementation and in the other two there are functions that use and config the CFileDialog
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
For runtime observations;
EnumChildWindows
GetDlgCtrlID
--
=====
Arman
|
|
|
|
|
Look in dlgs.h .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have got problem. How can I create under application, word file with text, which I want put there.
Does anybody now how to do it?
Thx
|
|
|
|
|
MS Word's Doc format, as much as I know, is not a free format, so it's not strange that there is not an article about it.
However it is possible to use reverse engineering or other hacks to find out the format of the file, and I'll not be surprised if I see some one did that already. Searching the web might help you find the format, after that it's as easy as creating a file with similar format and putting text into true order.
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Hamed Mosavi wrote: However it is possible to use reverse engineering
And what about simply using word automation ?
|
|
|
|
|
That's another solution
I've never used automation. Does it work in a situation that the end user has not MS Office installed?
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
You don't need to have word fully installed but you at least need to install the component.
|
|
|
|
|
Cedric Moonen wrote:
need to install the component
And is it freely available? I mean, can I redistribute the component with my setup for free? or is there license considerations?
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|