|
LilKoopa wrote: Ok, I have to do 3 programs for school and I am completely lost on how to start either of them off. If somebody could help me I would greatly appreciate it.
Start by knowing that "either" is a choice made between two things, not three.
That aside, you should be able to at least get started on any one of these. While you may need help with some of the details, you can't be in a programming course and not know how to start a project (regardless of whether it is pretty or even produces the correct result).
I see that your question has been asked elsewhere. See here and here.
"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
|
|
|
|
|
I have inherited someone else's c++ code that I need to increase the QueryTimeout value for, and I have run into a snag. They defined the recordset using this syntax:
From the .h file:
class test : public CRecordset
{
public:
test(CDatabase* pDatabase = NULL);
DECLARE_DYNAMIC(test)
//{{AFX_FIELD(test, CRecordset)
...
//}}AFX_FIELD
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(test)
public:
virtual CString GetDefaultConnect(); // Default connection string
virtual CString GetDefaultSQL(); // Default SQL for Recordset
virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support
//}}AFX_VIRTUAL
}
From the .cpp file:
IMPLEMENT_DYNAMIC(test, CRecordset)
test::test(CDatabase* pdb)
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(test)
...
//}}AFX_FIELD_INIT
m_nDefaultType = snapshot;
}
Eventually the query get's called using:
test m_test(NULL);
m_test.m_strFilter="Select Field1, Field2 from Table";
m_test.Open();
I've tried several methods to change the QueryTimeout value, all with no success. To make this work, I think I need to separate the indirect reference to CDatabase* pdb so that I can modify the settings for pdb. I've not been able to find any examples anywhere that discuss how this could be done differently without re-writing major portions of the program.
Can anyone please confirm if I'm on the right track, and if possible, what the code should look like to accomplish this?
Thanks,
SpT
|
|
|
|
|
Does this work?
CDatabase *pDatabase = new CDatabase();
pDatabase->SetQueryTimeout(30);
test m_test(pDatabase);
m_test.m_strFilter="Select Field1, Field2 from Table";
m_test.Open();
delete pDatabase;
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well, that was simple enough. I was looking to change it for the whole structure. Guess I was over-complicating it. Thanks much!
|
|
|
|
|
How the hell did you figure that one out! Dude that is like a puzzle inside a box inside a trunk inside a shark inside a whale inside a theme park located on the internet that you can't find on Google because you can't figure out the keywords to use!
WTF! I give up, gonna eat my filet-o-fish.
led mike
|
|
|
|
|
|
Classic post above this one, BTW
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
He's in a school daze. Don't worry, he will probably graduate without knowing how to find his ass with two hands and a flashlight then get hired by my company.
led mike
|
|
|
|
|
Hello,
I was trying to connect to remote MS SQL 2005, I can connect to server with microsoft client application, but when i try to connect with source code in visual c++, it returns: named pipes provider: could not connect, i dont know why?
here is my connection string:
Driver={SQL Native Client};Server=TestServer;Database=test;Uid=xIB;Pwd=xIB;MARS_Connection=yes;
anybody has any idea to solve the problem?
thanks in advance
|
|
|
|
|
|
|
Hi,
I wanted to disable the root node in a tree control in MFC, have not been able to do so. Could anybody help?
Thanks,
Software Developer
Sanjay Khapre
|
|
|
|
|
SanjaySMK wrote: I wanted to disable the root node in a tree control
So when the user clicks on it they can't expand the tree to see the child nodes? Then what's the point of even having the Tree Control?
led mike
|
|
|
|
|
what about CWnd::EnableWindow ?
or handle the mouse clicks to do nothing if the user clicks on the root ?
|
|
|
|
|
Hi all..
How do i hide my application from Task bar?? i.e My application should execute but it shouldn't show on taskbar..
Thanks..
Edit/Delete Message
|
|
|
|
|
|
|
gothic_coder wrote: How do i hide my application from Task bar??
ShowWindow(SW_HIDE) .
"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
|
|
|
|
|
ShowWindow(SW_HIDE).
Can you elaborate more on that?? I just need to hide my application button from task bar... The dialog will come properly..
Thanks.
|
|
|
|
|
gothic_coder wrote: I just need to hide my application button from task bar...
Which is what I showed. If, however, you need the dialog to be otherwise visible, see here, and here (about 3/4 way down).
In the future, please explain all of your requirements up front so that we do not provide you with less-than-helpful suggestions.
"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
|
|
|
|
|
You make your main application window a child window of a hidden parent window.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
Hello,
Being a very noob at c++, i managed to screw it up completely with this little piece of code
#define stdcall_api __stdcall
Now, at the time, i did not know this would hurt me in so many ways that would make the Spanish Inquisition proud, but apparently this had the effect of generating me 272 errors , all located in winnt.h and winbase.h, in all my Visual c++ 2008 projects that i have and need to build.
My question is: can i get my projects building again?
Thank you very very much,
A noob @ c++
|
|
|
|
|
what kind of errors are you getting (show the first ones) ?
|
|
|
|
|
Error 1 error C2146: syntax error : missing ';' before identifier 'Int64ShllMod32' c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h 654
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h 657
Error 3 error C2146: syntax error : missing ';' before identifier 'Int64ShraMod32' c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h 661
Error 4 error C2371: 'stdcall_api' : redefinition; different basic types c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h 661
Error 5 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h 664
Error 6 error C2146: syntax error : missing ';' before identifier 'Int64ShrlMod32' c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h 668
Error 7 error C2086: 'ULONGLONG stdcall_api' : redefinition c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h 668 OSPI
Error 8 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h 671
This kind of errors
|
|
|
|
|
just a guess, in what order are you #including your headers, and where do you #define you stdcall_api ?
|
|
|
|