|
1. What classes are you using to extract data from the database in the first place, and are you, by any chance, opening it exclusively?
2. You are prompting for a file to save to, yes? Is this a text file, or a new database?
If the latter, you need to create an empty database first.
Steve S
Developer for hire
|
|
|
|
|
Hi,
I am using standard accessor classes and using the Microsoft Jet DB engine 4.0. I open a session to the DB. Populate a grid with info from a table. There is a tree view which when clicked loads a different table. The user should be able to edit the contents, so I export the data to a .csv file using CFile and CArchive classes. The thing is I am launching a CFile dialog on clicking a button for exporting this data. What happens is that the application loses the DB connection. So after exporting when I click on the tree I have an error that displays DB connection lost.
Now what is really wierd is that I have functionality for importing data from the file. I have a copy of the database on the desktop and in my debug folder in a nested directory in C:\.. When I export I loose the connection to the Access DB in the debug folder. On importing somehow the DB on the desktop gets updated. The DB's have the same name and contents. I connect to the DB using a initialization string. Is the path of the DB need to passed for connection? If not then why does CFile dialog statement cause the app to loose the connection? I removed the CFile dialog statement and hardcoded a path to C:\XYZ.csv. Worked fine. By the way the code for setting up the connection is in another DLL and not in the executable. Have you faced this problem?
na.nu
|
|
|
|
|
na.nu wrote: What happens is that the application loses the DB connection. So after exporting when I click on the tree I have an error that displays DB connection lost.
This is not the result of a conflict between CFileDialog and the ATLDBCLI/OLEDB stuff.
How do you determine that the app has lost the db connection? Presumably you get errors when you try and access the db (eg clicking on tree)?
There's an AtlTraceError (or something) debugging function you can use which should give you more information on what's going wrong, but my normal rules for diagnosis would seem to apply.
Rule#1: Suspect your own code
Rule#2: Refer to rule#1.
It could be that when you use the CFileDialog, you're not initializing something correctly (like one of the pointers in the OFN structure), and it's trampling on some memory. This is notoriously difficult to diagnose; I generally dump the likely affected parts before and after calling the 'suspect' line.
Steve S
Developer for hire
|
|
|
|
|
In one of our software product, I was told by management to place a menu on one of the dialogs. The menu replaced a bunch of seldom used buttons and cleaned up the interface a bunch. The software was released to Beta recently. One of the guys working here that reviewed the software came up with something that I thought was kind of a bizarre thing to say. He said that "reputable" companies don't put menus on dialogs.
I was kind of shocked at that. I have never heard of such a thing. I searched and could not find any reference to any standard that forbids menus in dialogs.
So, that got me curious to see what other people do. Do you use menus in dialogs? If not why not?
Thanks
Wes
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
Wes Aday wrote: I have never heard of such a thing.
Neither have I. But I've also never heard of non-reputable companies putting menus on dialogs.
Wes Aday wrote: Do you use menus in dialogs? If not why not?
No. They probably have their place, but our product does not warrant them.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I've never had to put a menu on a dialog, but it would be okay to do if it was necessary, especially if the dialog was the main window of an application (like in a dialog based application).
Tell the guy he's full of shit.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
never heard such a thing neither...
and we do (even we program in java), some of our dialogBoxes contains menus. and guess what companie i work for ?? i think Accenture is more than a "reputable" companie, so...
|
|
|
|
|
Sounds pretty silly to meeee too, to say such a thing. But maybe: reputable or not, it would be a good idea to put them buttons on a seondary tab instead, depending on the style of other parts of your app
_____________________________________
Action without thought is not action
Action without emotion is not life
|
|
|
|
|
I've never put a menu on a dialog myself, but I don't see why it should be a problem.
|
|
|
|
|
Don't know about "reputable", but a menu bar on a dialog does look confusing to me. Have you ever seen such a thing in any MS product for instance?
|
|
|
|
|
Nemanja Trifunovic wrote: ave you ever seen such a thing in any MS product for instance?
i don't think this is an evidence, because MS wrote (at the begining of Windows95 days) a document for the dos and don'ts in designing Windows GUI, but they don't even respect it now... (especially thinking Office applications and MSN Messenger for instance)
|
|
|
|
|
IMHO, do what needs to be done to improve the usability of an interface. If that involves adding a toolbar, menu bar, or removing a control, so be it.
Let the feedback from your users to decide if it was the right decision or not.
FWIW, I believe that MS Small Business Manager uses menus on its sub-interfaces, and they are basically dialogs with menus.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
He's almost completely wrong.
Dialogs, especially modal dialogs, are to execute one operation. So if you need a menu on the dialog, this may indicate that for this operation, a dialog is not the best choice. However, these rules are not too solid.
Secondary reason: Since Menu background is (usually) identical to dialog background, the menu does not stick out so much, so some users might miss it. It is easier to find if you put it an a "More.." button, that opens the popup menu.
But neither reason is a "don't do", both are just "think twice if you can do better".
Out of curiosdity. can you ask him who he considers to be a "reputable" company?
|
|
|
|
|
peterchen wrote: Out of curiosdity. can you ask him who he considers to be a "reputable" company?
I have not personally talked to him. He is not in my department so I do not see him usually. So, I have no idea what a reputable company would be....
Besides.... we have never claimed to be reputable anyway....
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
Thanks all for your response. I appreciate the time.
Went pretty much as I expected.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
I think he has a point. I wouldn't go as far as him, and every rule has its exceptions (like the dialog as a main window case), but not using menus bars on dialogs is a good guideline. What makes applications easy to use is uniformity so unless you've got a compelling reason to deviate from the standards (both explicit and implicit) I'd suggest you don't.
Steve
|
|
|
|
|
I dont know if this is the place to put this, but can anyone tell me how to put devC++ on a flash drive?
|
|
|
|
|
If you're trying to make it so you can take it with you, I don't think it'll work because it puts crap in your system32 folder as well.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Said stuff being debug versions of MFC dlls et al.
I have 'installed' VC6 and Feb04 PSDK on a CD, along with a regfile that I pull in to allow me to use it on my laptop, which had VS2005 already installed on it.
It's not perfect, but it's doable.
Steve S
Developer for hire
|
|
|
|
|
I'm write project under VC++ in .Net framework. I need to write shared.cpp/shared.h to including all global constants which used by other .cpp/.h files in the same project.
i.e.
Once x is defined in this shared file and don't need to be defined in any other .ccp/.h files and can be directly used.
String* x = new String(" NAME ");
|
|
|
|
|
#include < gl\glu.h >
Are we telling the compiler to look in the folder gl in the standard library to find glu.h?
Why is is indicated using a backslash?
#include < netinet/in.h >
Why are we using forward slash in this case?
Thanks,
Jay
|
|
|
|
|
don't use backslashed... use forward slashes to avoid characters escapment problems...
the fact is that one syntax is mostly for windows world, while the other is mostly for unix world. but as forward slashes work fine on every plateforms, i think it's the best way to go.
|
|
|
|
|
what's character escapment
|
|
|
|
|
Jay03 wrote: what's character escapment
Character combinations consisting of a backslash (\) followed by a letter or by a combination of digits are called “escape sequences.” Examples include, but are not limited to:
\b backspace
\f formfeed
\n newline
\r carriage return
\t tab
\\ backslash
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
don't you know that the '\' character in C/C++ is the escapment character ?
\a : alarm
\b : backspace
\n : newline
\t : tab
\r : carriage return
etc...
|
|
|
|