|
Nope, that aint the proble. would be really quick
and srry about the code, its just a test project. when i got it all working i'm gonna merch it and mostly rewrite it.
Thanks anyway
|
|
|
|
|
hi,
I can't seem to create a simple c++ console application in VStudio .NET 2003. Whenever I create the console application provided in the template projects, I can't compile with for example, the system function cout
What could I be doing wrong?
If this can't be fixed, is there going to be a problem if I install both VStudio6.0 and VStudio.NET 2003 in the same machine/OS?
Thank you and Happy New Year
I'm a SysAdmin, I battle my own daemons.
|
|
|
|
|
Don't forget to include the iostream header file.
#include <iostream>
Darka [ Xanya]
"I am not a slave to a god that doesn't exist."
|
|
|
|
|
Thanks but I have done that. Besides it already includes "stdafx.h"
|
|
|
|
|
|
i thought the problem was being caused by the new vstudio .net (i am new to .net)
anyhow, this helped... thanks!
|
|
|
|
|
Hi
Why after this piece of code value of d is : 3.4560000896454 ?
float f = (float)3.456;<br />
double d = (double)f;
Thanks
|
|
|
|
|
In computers, real values are only approximations; there are only a limited number of bits used to represent fractional values. You need to keep that in mind when dealing with float and double type values. The double type includes a larger number of bits (64 in the Windows world) than the float type (32).
When you do the conversion from one to the other via the (double) cast operator, those extra bits come into play. In a float value, 3.456 may have a string representation of 3.456000. A double version of that value adds additional significant digits, which results in the 3.456000089454 that you are seeing.
Software Zen: delete this;
|
|
|
|
|
Hi,
I have a base class(lets say class X) which is a "friend" of another class(lets say Class Y).
Using the base class(class X) I can access private members in the other class.
My problem is that I derived a new class(class Z) from the base class,and I need to use a private method from class Y.
I thought that if class X is a friend of class Y , then all the derived classes of class X are also friend of class Y , but I realized that I was wrong.
My problem is that I can't modify class X and class Y because it is our core.
anyone?
With best regards,
Eli
|
|
|
|
|
declare the friend as protected
|
|
|
|
|
I've made an SDI Appl with DB Support by MFC Wizard. now in an ADmin module i validat the password supplied by the Administrator and open a Modal Dlg Box with certain Edit Text fields radio buttons.
I've 4 buttons in it.
1) Add
2) Inventory
3) Edit
4) Exit.
On addition i want to add the values in these fields to the DB. but i'm not able to add the member variables to m_pSet-><Field_Name> values to that of the edit text boxes. also I ve a field as accession number(1111-9999) which is a p_key. while we add an item the greatest acc. no. has to be read n a next gr8er no needs to be gen. associated with the item.
The basic prob is how to update data without closing the Dlg Box.
I know this is a lengthy one...plz bear with it.
Success makes life easier. It doesn't make living easier.
SH UVIK
|
|
|
|
|
|
No i cant let a user access the SDI window when he/she is accessing the Dlg Box.
I just used DDX but still until the Modal Dlg Box Closes I'm not able to invoke update to DB.
how to do it
Success makes life easier. It doesn't make living easier.
SH UVIK
|
|
|
|
|
shouvik.d wrote: No i cant let a user access the SDI window when he/she is accessing the Dlg Box.
Disable the SDI window while the dialog box is active. MFC simulates modal dialog boxes exactly in this way, creating a modeless dialog box from template, disabling main window if any, display the dialog, and reenable the main window after.
Another possibility is to inform application from the modal dialog to perform the update.
This way you don't have to wait the dialog to close, such as in
void CDlg::OnButtonClicked()
{
CData data;
static_cast<CSDIApp *>(AfxGetApp())->updateDatabase(&data);
}
and
void CSDIApp::updateDatabase(CData *pData)
{
}
|
|
|
|
|
firstly thr is no CData class only CDatabase is available.
and plz can u throw a bit more light into this. I'm an amateur n very new to VC++.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
SH UVIK
|
|
|
|
|
I mean CData as a placeholder for your data, you should implement it yourself as a mean to communicate between the dialog and the application object. In this way, you can collect data from the dialog, declare and fill a structure or class (this is CData) and pass it to the application (or whatever other object you want to delegate for operating in database).
|
|
|
|
|
This is what when the admin module has to be invoked. A passsword validation is done. Later the Admin window opens.
void CLibManView::OnAdmin()
{
Pass p1;
p1.DoModal();
CString str,query,str1;
int flag = 0;
str=p1.m_pass;
m_pSet->Close();
query = "Select * from Password where User='Admin'";
m_pSet->Open(CRecordset::dynaset, (LPCTSTR)query,CRecordset::none);
m_pSet->MoveFirst();
while(!m_pSet->IsEOF())
{
str1=m_pSet->m_Pass;
if(str1==str)
{
flag=1;
break;
}
m_pSet->MoveNext();
}
if(0==flag)
MessageBox("Wrong Password");
else
{
ad.DoModal();
m_pSet->Close();
char temp[2];
itoa(ad.type,temp,2);
char locstat[2];
itoa(2,locstat,2);
query="insert into book values('"+ad.m_Auto_Ac_No+"','"+ad.m_Add_Name+"','"+ad.m_Add_Auth+"',"+temp+","+ad.m_Add_Price+",'"+ad.m_Add_Date+"',"+locstat+")";
m_pSet->Open(CRecordset::dynaset,(LPCTSTR)query,CRecordset::none);
m_pSet->Update();
m_pSet->Close();
}
}
So without closing the Admin dlg box how to update data. also i'm getting an error.
Syntax error in FROM clause on the above query.
plz help
Man can acquire accomplishments or he can become an animal, whichever he wants. God makes the animals, man makes himself.
G. C. Lichtenberg (1742-99), German physicist, philosopher.
SH UVIK
|
|
|
|
|
One method is to do what Cristian Amarie said above. Another is to move the SQL code into the dialog itself.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
But i am not able to access the m_pSet-> variable in the Dialog Box.
So how can i update the fields which can be accessed through only the REcordset object m_pSet.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
SH UVIK
|
|
|
|
|
You can pass the m_pSet pointer to your dialog class when you start the dialog.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
plz help
Man can acquire accomplishments or he can become an animal, whichever he wants. God makes the animals, man makes himself.
G. C. Lichtenberg (1742-99), German physicist, philosopher.
SH UVIK
|
|
|
|
|
You got the help already.
1. Pass the database objects as pointers (or references) to the dialog and do the DB work directly inside dialog.
2. Use a messaging mechanism (not especially Windows messages, although could work too) to signal back from dialog to the object that contain your variable m_pRecSet to "do the DB work".
3. Use a separate class that does the DB work, declared by the application object, main window object or where you see this fit, and use a messaging mechanism back and forth to/from this object to any object that require "DB services".
Whenever a DB operation needs to be performed, you must have the means to retrieve and use the DB object, either directly (1), via accesors of other objects (2), or using a convenient object that encapsulates the DB services (3). The solution is up to you, as well as what kind of services can be performed - direct brute queries formatted elsewhere, or using more specialized business logic oriented derived classes.
I suggest you to implement a hierarchy like:
Connection
Statement
StatementWithResults
Recordset
StoredProcedure
...
(whatever you like)
as well as your business objects which can derive from StatementWithResults (1 row in a table) or Recordset for collections.
|
|
|
|
|
hi all,
i am trying to develop a program that requires sending some small mails to some mail-ids, I tried with the code supplied by Nishanth Sivakumar: http://www.codeproject.com/tips/CSMTPConnection2.asp
I am using Visual studio 6.0, and it is not detecting the atlsmtpconnection.h header file. Is this header available in Visual studio-6.0, if yes what setting should I change to get it compiled
Thanx in advance,
SYAMLAL
|
|
|
|
|
SyamlalS wrote: I am using Visual studio 6.0
Read the article you linked to. It specifically says you need VC7 or above.
In the meantime you can use this[^] class in VC6 or even use the Simple MAPI[^] functions.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
thank u PJ Arends
SYAMLAL
|
|
|
|