|
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.
|
|
|
|
|
|
Hi 0300
This is not the proper way to ask. We all are here to help each other.
As Cedric said whenever you stuck to any problem and don't find the solution you can post your queries. No one here is going to provide the full source code.
So first start yourself .
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Hi 0300
for another modes
you should fisrt start to write your program and then asked a question
or if you have a problem.
(Cedric Moonen and Ganesh_T and another friends are good programers )
|
|
|
|
|
You Start it v help u PROCEED;)
|
|
|
|
|
Hey 0300,
if you are new to this forum its ok
from now try to avoid such words so that some one hurts
we are here for helping each other not dedicated for providing source, we can help you to give suggestions.
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
can anybody tell me how can i load & read the XML File.I'm stuck on this point please give me solution.
i have alrady wastage last two days & still there.
for ur information i can tell u that i have made a MFC Application using wizard.
and want to print the vital information of XML File on the Active Document.
Aavesh
|
|
|
|
|
aavesh wrote: i have alrady wastage last two days & still there.
Have you looked at DOMDocument or IXMLDocument ?
"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
|
|
|
|
|
i saw it and i'm able to open the file successfully but the problem is to print the XML Data on the Active document.
how could i achieve this.
Aavesh
|
|
|
|