|
Hi
I've the following code to generate permutations of my vector v:
<br />
while (next_permutation(v.begin(), v.end() ) ) { <br />
copy(v.begin(), v.end(), ostream_iterator<int>(cout, ""));
How can I make it output to a vector instead?
I know I need to change to ostream_iterator, but what to?
cheers
-- modified at 11:14 Monday 3rd April, 2006
|
|
|
|
|
back_inserter
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
What does the CAuxThunk and CAuxStdThunk classes do? What purpose does InitThunk have and why do we have to pass a Procedure name to it? What does TMPF stand for and what does it do?
Thanks...
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Hi friends,
I've done a project which is dialog based application.Now I need to connect databases.So how do I proceed now.Do Ineed to redo the whole project in SDI.Pls help me in solving this problem.
bye
swapna_signsin
|
|
|
|
|
What sort of database are you trying to connect to?
|
|
|
|
|
|
|
swapna_signsin wrote: Now I need to connect databases.So how do I proceed now.
If you already have a DSN created, just derive a class from CRecordset using ClassWizard (Ctrl+W).
swapna_signsin wrote: Do Ineed to redo the whole project in SDI.
No, not at all.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanx for the reply,
but how do u create a DSN in Dialog based application.I mean how do u make use of ODBC Connection,bcoz u don't have a document/view when u'r using dialog based.
|
|
|
|
|
swapna_signsin wrote: but how do u create a DSN
Use SQLConfigDataSource() .
swapna_signsin wrote: I mean how do u make use of ODBC Connection...
CRecordset handles the details for you. Just derive a class from it.
swapna_signsin wrote: ...u don't have a document/view when u'r using dialog based.
Whether you use document/view or not is irrelevant.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
HI,
Actually Iam a beginner,Sorry to trouble u again,So how do u connect to DSN in Dialog Based applications,bcoz u don't have a Doc/View in this and u can't connect ODBC thru that.I've to connect to MSACCESS database.
Pls do reply,
bye
swapna_signsin
|
|
|
|
|
swapna_signsin wrote: So how do u connect to DSN in Dialog Based applications...
In exactly the same way you would in any other application.
swapna_signsin wrote: I've to connect to MSACCESS database.
After you've got a DSN created (see here for an example), use ClassWizard to derive a class from CRecordset .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi again,
I've tried it and I get the following errors :
1. 'CRecordSet' is not a class or a namespace namefor foll code: CRecordset::Dump(dc);
CRecordset::AssertValid();
2.'CFieldExchange':Undeclared Identifier
3.'CDatabase': Undeclared Identifier
and many of taht sort.
swapna_signsin
|
|
|
|
|
You failed to include afxdb.h .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanx,I'll try it and reply soon.
bye
swapna_signsin
|
|
|
|
|
I have
CDialog::PostNcDestroy();
m_pParentWnd->SendMessage(UDM_LISTCLOSED,0,0);
delete this;
and in the .h file
public:
virtual BOOL OnInitDialog();
protected:
virtual void DoDataExchange(CDataExchange* pDX);
virtual void PostNcDestroy();
The dialog was created by:
if(!m_tgtInfo)
{
m_tgtInfo = new CTargetInfo(this, caseStudy);
if(!m_tgtInfo) return true;
m_tgtInfo->Create(IDD_DLGTGTINFO, (CWnd*)this);
m_tgtInfo->ShowWindow(SW_SHOW);
}
When I close this modeless dialog, execution does not enter the PostNcDestroy function. However if I close the whole app, then the code does go into this function. What am I missing? I looked at sample code and there does not seem to be anything else I need to do...
thanks,
sb
-- modified at 9:00 Monday 3rd April, 2006
|
|
|
|
|
ns wrote: CDialog::PostNcDestroy();
delete this;
Switch these two statements.
ns wrote: When I close this modeless dialog, execution does not enter the PostNcDestroy function.
Have you called m_tgtInfo->DestroyWindow() ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
When am I supposed to call m_tgtInfo->destroyWindow()? The user closes m_tgtInfo at which point I was trying to send a message to the parent (which instantiated m_tgtInfo)
thanks for helping,
sb
|
|
|
|
|
ns wrote: When am I supposed to call m_tgtInfo->destroyWindow()?
When you want to dismiss the modeless dialog.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
A miscommunication, I think.
The user closes the m_tgtInfo dialog using the system menu at the upper right corner (the cross). I don't dismiss it with code. Am I still missing your point? When the cross is clicked, I thought the postNcDestroy() function would run, but it doesn't. Thanks for your patience.
sb
|
|
|
|
|
Do you have the following:
void CTargetInfo::OnOK()
{
DestroyWindow();
}
void CTargetInfo::OnCancel()
{
DestroyWindow();
}
void CTargetInfo::OnClose()
{
DestroyWindow();
}
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
No, I didn't have that. I put it in, and everything works as expected now. Many thanks for spelling it out
|
|
|
|
|
Dear Members
Hello,
I have a problem.I have assigned to make such a calculator which has 4 modes
1.Binary
2.Decimal
3.Hexadecimal
4.Octal
In these four modes I want to make arithmetic calculations(Addition and Subtraction).But I haven't the proper source codes of this C++ programe.Plz if anyone has tht type of source codes then inform me as soon as possible.
Best Regard
|
|
|
|
|
And when you will find a job and that you will be asked to do something, will you also ask people to do the job for you ?
Start working on your homework, and when you get stuck, come back here and post SPECIFIC questions.
|
|
|
|
|