|
Hello, the codegurus around the world.;)
Basically, it depends on the customer requirement about SDI or Dialog based
application.
I think that ADO is easier to access SQL server (even Access database),
and ADO doesn't matter which GUI we use.
When we connect SQL Server?
When we check the client application of SQL Server, the menu has "Connect"
menu to access SQL Server. So, it is OK if we didn't show the login dialog
before SDI shows.
However, if the customer wants to do this, we have to do this.
We can put CMyDialog.DoModal() in the following functions before SDI shows.
BOOL CMyApp::InitInstance()
{
CMyLoginDlg(NULL);
CMyLoginDlg.DoModal();
.......
}
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
it is beter to create a dialog for the login purpose..and just add a menu Login ,and all the unanted menus at the time of login keep disable...and when the menu clicks doModal the dialog,in the dilaog,u must connect and check for the requred info from database..(if u choose ODBC DSN ,i think thats better)..
Renjith-The Teckforce.
|
|
|
|
|
bppotato wrote:
in this case there isn't any database support which i need.
Personally I wouldn't use the wizard to generate the database code. It is far too inflexible and was designed for a different age. You'd be better of using ADO through #import (See the ADO section here at CodeProject)
An SDI document base is the most flexible option to choose, you can pretty much hack the code around to your own desires. Like others have said you can launch a seperate dialog from InitInstance of the CWinApp derived class or in the InitialUpdate type functions CView class.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
bppotato wrote:
Since my project require me to have a login at the
first place(for control) i believe the dialog base is needed. But then
in this case there isn't any database support which i need.
Are you planning to build the whole application around login screen? I guess not. You should first select how the main application window will look (SDI? MDI?) and then add additional dialogs. Both SDI and MDI choices support MFC database classes. However, as somebody already mentioned, default database support in CRecordView (or whatever it's called) is too limited. You should build your forms separately and wire them to database classes.
If i choose the single document base, how do i make sure the
"login" interface will appear before any other interface.
You have to do something yourself. Make your application SDI, and then create a new CDialog-based class. Then inside InitInstance insert something similar to this:
CMyDialog dlg;
while(!dlg.LoginSucceeded())
{
if( dlg.DoModal() != IDOK )
break;
}
Good luck!
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
If you're in a war, instead of throwing a hand grenade at the enemy, throw one of those small pumpkins. Maybe it'll make everyone think how stupid war is, and while they are thinking, you can throw a real grenade at them.
Jack Handey, Deep Thoughts
|
|
|
|
|
Hi, everyone!
Please look at the following statement,
--------
#define assert(x) ((void)0)
--------
What does the statement mean? What is the function
of "((void)0)" here?
Another question, there is a paramater "x" in the former
"assert(x)", why there is not a parameter in the latter
"((void)0)"?
Cheers,
George
|
|
|
|
|
i think
in this macro,if u pass a variable containing a value;and then here u put ((void)0),that will show an ASSERTION FAILURE.!!! dialog..
DWORD dwmydw = 4567 ;
asert(dwmydw ) will show the assertion failure dialog..
Renjith-CPian.
|
|
|
|
|
Thanks, Renjith pal!
I think your case is correct. But I think
the function of the statement is not to
invoke the assert failure dialog box.
What is the funciton of the statement? I
have seen a lot of cases that the same
statement is using.
Cheers,
George
|
|
|
|
|
((void)0) will compile to nothing. You usually see something like this
#ifdef _DEBUG
#define assert(x) some_assert_function(x)
#else
#define assert(x) ((void)0) // make assert become nothing
#endif
so that assert's are only enabled in debug builds.
Todd Smith
|
|
|
|
|
Thanks, Todd pal!
Your reply has clarified all my doubts.
Have a nice weekend,
George
|
|
|
|
|
Dear All,
I hope anyone can help me out with this seeming simple problem.
I've implemented a dialog bar with buttons on them which I would like to disable them from time to time. I've used
m_wndDlgBar.GetDlgItem(IDC_BUTTON1)->EnableWindow(FALSE);
and it wouldn't work.
I even disabled it with the resource editor.
Thanks very much for your precious time.
Regards
CT
|
|
|
|
|
Hi there !
It's Hadi with other question about ADO classes
Well, as all of you know ... when you use FindFirst or FindNext, ado engine move the recordset to new record if the record finded ...
My problem is about m_Rs.Find( string, CADORecordset::searchBackward );
This function works well when it find a record but it DOESN'T MOVE the recordset to finded record
What's wrong ?
How can i move the recordset to finded record when i'm using Find( string, CADORecordset::searchBackward ); ???
Regards
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
lets say i have some audio information that i want to output, can anyone point me in the right direction?
Thanks.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
sndPlaySound() if it's a wavefile... (Or a wavefile from a resourcefile)
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
I am a proficient C++ programmer and am familiar with Win 32 Api programming, but am just learning MFC.
I want to write an MFC application that will detect which America's Army Server I am connected to, create an updated webpage and then upload that page via ftp to my websever.
What do I need to learn in order to
a) detect the ip and port numbers to which I am connected.
b) log on to an ftp sever and upload a file.
I could probably do this with dos commands using netstat and a comand line ftp app, but I would rather not.
|
|
|
|
|
Search on MSDN for the Winsock and sockets. This should give you a starting point for reading about IP comms.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
i want to simulate workspace in vc++,i use CTree on the CDialogBar.i want to if select the item that opened active else run OnNewFile.Please Help me
|
|
|
|
|
Send message to your main view,when user selected the tree item.
Sincerely,Pole.
|
|
|
|
|
i want to simulate workspace in vc++,i use CTree on the CDialogBar.i want to if select the item that opened active else run OnNewFile.Please Help me
|
|
|
|
|
i want to simulate workspace in vc++,i use CTree on the CDialogBar.i want to if select the item that opened active else run OnNewFile.Please Help me
|
|
|
|
|
I have a small logging utility that I use across several different applications. When I try to use it from withing an NT Service I can't get any logging. Any gotchas you've run across regarding using COM from an NT Service?
Thanks,
ed
|
|
|
|
|
In general, there is nothing that prevents COM components from being used in NT services. There are some issues you should know:
1. NT services run in a special account that don't interact with user, so if your component tries to display a message box, you're out of luck. Moreover, if you happen to use some MFC classes that cause assertion, they will end up (at least in DEBUG mode) displaying message box that will stop the service (of course without displaying anything).
2. Be careful with use of MFC user interface classes (in other words, don't use them). You can use MFC collection, thread and string classes.
The easiest way to discover what's wrong is to debug your service (select its process in task list, right-click and choose "debug").
Hope this helps.
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
If you're in a war, instead of throwing a hand grenade at the enemy, throw one of those small pumpkins. Maybe it'll make everyone think how stupid war is, and while they are thinking, you can throw a real grenade at them.
Jack Handey, Deep Thoughts
|
|
|
|
|
I don't use any user interface. I have a separate control panel applet that handles that. Working on the debugging though...
Thanks,
ed
|
|
|
|
|
That may sound silly, but did you call CoInitialize ?
Also, if you want to see pop-ups from your NT service, you choose "Interact with desktop" check box for the "LogON" tab in the service properties. That way, you may see any assertion failed dialog boxes.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I did. I use a little struct (below - found somewhere??) to initialize and uninitialize.
<br />
struct CComInit {<br />
CComInit() { CoInitialize(NULL); }<br />
~CComInit() { CoUninitialize(); }<br />
};<br />
Then during initialization:
<br />
CComInit comInit;<br />
Thanks...
ed
|
|
|
|