|
|
In this:
CFileDialog fileDlg1(FALSE, ".mdb", NULL, OFN_OVERWRITEPROMPT, "Database Files(*.mdb)|*.mdb||",NULL);
the OVERWRITEPROMPT shows up with the dlg box. How do we process its return value? WHat I mean is we have IDOK and IDCANCEL for the CFileDialog itself. Additionally we have this OK or NO for the message box as well. SO it looks like we have to handle the CFileDialog return values and also the returns of the messagebox. Its not automatic that the overwrite will take place right? We have to code that part in, is that correct?
A little
Appreciate your help,
ns
|
|
|
|
|
If you say 'No' to the 'overwrite prompt' message box, your CFileDialog stays open and doesn't return from DoModal.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
you don't have to (and cna't, i think) handle the return from the overwrite prompt.
-c
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
I want to see if a file exists. GetStatus is a bool. FRom MSDN (says use the static version to check existence) its not clear to me what part of:
CFile::GetStatus( pFileName, status )
is telling me whether it exists or not. Returns true if it could get status info. So a False return value can be considered proof that the file doesnt exist?? Is that a valid assumption? If not, how do I use this static version of GetStatus to find out if the file exists?
Appreciate your help,
ns
|
|
|
|
|
That's what I'm using:
bool FileExists(const char *szFilename)
{
WIN32_FIND_DATA findFileData;
HANDLE hFind = FindFirstFile(szFilename, &findFileData);
if (hFind == INVALID_HANDLE_VALUE)
{
return false;
}
VERIFY(FindClose(hFind));
return true;
}
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
Can I use this in MFC? Thanks
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
Can I use this in MFC?
Yes.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
what about _access function, you only need to check if returns 0, or -1...
Cheers....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Do it the easy way:
use PathFileExists().
|
|
|
|
|
Lots of options to choose from now. Many thanks for all the responses!
Appreciate your help,
ns
|
|
|
|
|
Jim A. Johnson wrote:
use PathFileExists().
Doesn't work on ancient systems without IE4 or later.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
The linker had a problem, I did include Shlwapi.h.
rain1View.obj : error LNK2001: unresolved external symbol __imp__PathFileExistsA@4
Appreciate your help,
ns
|
|
|
|
|
Link with Shlwapi.lib . I really must post that FileSystem code...
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Okay. I used the other resolution posted by Tomasz - works great!.
How do you link ? Never done that. I went to the link tab in Project settimgs but that didnt look like a place where I could put that .libs name..
Appreciate your help,
ns
|
|
|
|
|
In the Object/Library modules field.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
hello,
does anyone know how to get rid of the request timeout message using the
OpenUrl function of the internet transfer control object in Visual C++?
Or is there a sample out there on how to use the Execute function of the
same object. Is there a different component that I can use instead that would transfer an html document into a string and viceversa.
thanks,
herbert
|
|
|
|
|
hi
we are doing a project creating a graphics package. At that time they will take multiple doucment interface and commented the CView class. now i am doing printing. in printing i have to print particular area. without CView i can't do this. so now i want to create a CView for temporary at the time of printing. how can i do this. please help me
thank you
from
venu
|
|
|
|
|
In my program I need to give the user an option of printing many different kinds of files by loading the default application associated with a file type (as VC++ would load when you double click on a .cpp file) and passing "/p < filename >" as a parameter to print.
Is there some kind of shell function that I can use to retrieve the application path associated with a file type?
Thanks for any help you guys can give!
- Houdini
|
|
|
|
|
But not all applications will print a document by passing it "/p filename" arguments.
Signature space for rent. Apply by email to....
|
|
|
|
|
Most application should support this. "app /p filename" is a standard Windows parameter to print a document, just as "app filename" is a standard Windows parameter to load a file when the app starts.
Any application written in MFC/VB supports this automatically as it's built into those libraries. Don't know about other libraries, but I would think they would considering /p is a stardard windows param.
In any case, most will support it, and the ones that don't should at least load the application with the file so the user could just hit file/print in the application.
|
|
|
|
|
I'd use ShellExecute with 'print' verb.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
OMG, how could I have missed that? I had tried using /p as the verb. Apparently I don't know how to read the MSDN very well .
Thanks!
- Houdini
|
|
|
|
|
Hi,
i'm trying to do a program with a main dialog and a second that is opened or not from the first. The main dialog is modal and the second is modeless but when i create this last one there's another instance in the system bar of window and i want to hide it, is it possible?
It's possible to make the 2 dialogs modeless?
Thanks
|
|
|
|
|
Gian wrote:
there's another instance in the system bar of window and i want to hide it, is it possible?
I'd like to help you, but have no slightest idea what do you mean by 'instance in the system bar of window'. Could you explain that part in more detailed fashion?
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|