|
You are missing semicolons after the following lines
federalTax = grossPay * .25
netPay = grossPay - federalTax
|
|
|
|
|
Thank you so much, I don't know how I made such a dumb error.
Jonathan
|
|
|
|
|
hey guys, i'm pretty new to C++ and have a program i'm trying to write. i basically have the .h file done except for the private data members. the project instructions are below as well as what i have of the .h file. i'm sure you guys probably think this is easy but if anyone can do it so atleast i have something to refer to i'd aprecitae it. thanks
Your job is to implement and test this ADT using an array allocated with the new operator in the constructors and de-allocated with the delete [] operator in the destructor. You will find that three data members will be sufficient for the job. At a minimum, you must test each function with enough different arguments to show it works.
You are allowed to define additional helper functions, member functions or otherwise
//---------------------------------------------------------------------------
#ifndef MyStringH
#define MyStringH
//---------------------------------------------------------------------------
typedef char CharType; // Allow for other character types
class String
{
public:
// Constructors and Destructor
String( int capacity = 50 ); // Make empty String with given capacity
String( const String & str ); // Copy str
String( const CharType * str, int capacity = 50 ); // Make str a String
~String();
// Queries
unsigned Length() const { return count_; }
bool IsEmpty() const { return (count_ == 0); }
bool IsFull() const { return count_ == capacity_; }
int IndexOf( const String & str );
String SubString( unsigned start, unsigned count ) const; // Copy out
const CharType * c_str() const;
// Modifiers
CharType & operator[]( int index ) { return string_[index]; } // Unsafe
bool Delete( unsigned start, unsigned count );
bool Insert( unsigned pos, const String & str );
private:
I NEED THE PRIVATE DATA MEMBERS FOR HERE
};
//---------------------------------------------------------------------------
#endif
thanks again
|
|
|
|
|
Will Try to help you out.
Luckyhuss
|
|
|
|
|
homework ?!
do it your self !!!
we are here to help, no to do your job...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You are allowed to define additional helper functions, member functions or otherwise ;);P
|
|
|
|
|
I'm using _spawnl to launch an external application. This works very well. But when I call _spawnl from within a thread created with AfxBeginThread, the program crashes.
What's the catch here?
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
Use CreateProcess() or ShellExecute() in Win32.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
can you paste the line which uses _spawnl(), over here.
suhredayan There is no spoon.
|
|
|
|
|
Currently I have a dialog based application that closes automatically if the user hits the "return" key. How do i disable this?
|
|
|
|
|
|
If I disable the OnOK and OnCancel, how can I close the app when a user clicks on the "x" from the system menu or selects the File Ext command?
|
|
|
|
|
JKallen wrote:
If I disable the OnOK and OnCancel, how can I close the app when a user clicks on the "x" from the system menu or selects the File Ext command?
http://blog.voidnish.com/index.php?p=31[^]
|
|
|
|
|
Hey all,
I have been trying to get this to work for a solid week now and I cannot seem to do it. I've used CSpreadsheet from here, but it doesn't work right, so I decided to do my own CDatabase attempt at it in order to debug.
I am doing
strConnection.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s","Microsoft Excel Driver (*.xls)", "c:\\test.xls", "c:\\test.xls");
then...
myDB.OpenEx(strConnection,CDatabase::noOdbcDialog);
sqlString.Format("SELECT * FROM [Sheet1$]");
while (!recset.IsEOF()) {
recset.GetFieldValue(6,sValue);
MessageBox(sValue);
recset.MoveNext();
}
What is happening is that it is returning all of the values, except straight number/currency fields in that row. (If I designate the row as "Text" and put 1000 in there, it will not show it in the msgbox (its blank). If I put D1000 (a letter in there), it shows D1000 in the msgbox.)
The CSpreadsheet class that is posted on this website does the same thing. For some reason the Microsoft Excel Driver / SQL statement is not getting number values and I cannot for the life of me figure out why. I've been reading for 3 hours straight and am so burnt out and would appreciate it if someone could shed some light on this
THX!
|
|
|
|
|
This code snippet worked for me:
CString strConnection,
strSQL,
strTemp;
CDatabase myDB;
CRecordset recset(&myDB);
CDBVariant sValue;
strConnection.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s",
"Microsoft Excel Driver (*.xls)",
"c:\\Book1.xls",
"c:\\Book1.xls");
myDB.OpenEx(strConnection,CDatabase::noOdbcDialog);
strSQL.Format("SELECT * FROM [Sheet1$]");
recset.Open(CRecordset::forwardOnly, strSQL, CRecordset::readOnly);
while (! recset.IsEOF())
{
recset.GetFieldValue((short) 0, sValue);
strTemp.Format("%f", sValue.m_dblVal);
AfxMessageBox(strTemp);
recset.MoveNext();
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a pull-down list that opens up each child window using the CMultiDocTemplate::OpenDocumentFile() function. Some windows become hidden when another is active so I'd like to bring the window to the top when the user selects it from the pull-down list. Here's some of the code I have:
void Fruits::OnSelchange()
{
switch (m_fruits.GetCurSel())
{
case 0 : //apple
if (!pAppleTemplate)
{
pAppleTemplatee = new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMPSDoc),
RUNTIME_CLASS(CMDIChildWnd),
RUNTIME_CLASS(CApple));
pAppleTemplate->OpenDocumentFile(NULL);
}
else //if already open, make active
<-----code to activate window----->
break;
case 1 :
if (!pBananaTemplate)
{
pBananaTemplate= new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMPSDoc),
RUNTIME_CLASS(CMDIChildWnd),
RUNTIME_CLASS(CBanana));
pBananaTemplate->OpenDocumentFile(NULL);
}
else
<----code to activate window---->
break;
}
Any help would be much appreciated. Thanks!
|
|
|
|
|
Currently I am using the DAO SetFieldValue()/GetFieldValue using COleVariant in my MFC OCX to set fields in an access table that accept data types such as string, numbers, currency, etc. How do I set or embbed a field with its data type defined as "OLE object" such as a word docuument or an excel worksheet in an access table design view? Any help would be appreciated.
|
|
|
|
|
I'm building a normal set of .h and .cpp code files using VAC++ 6.0 with all the latest fix packs installed.
I've run into a real progress stumper. The code compiles fine but when I try to run a test the items declared in the .h file are not found in the .cpp file. I've compared the settings to many other projects that work fine and I've never seen this type of problem before. Suggestions?
class CSapRfc // .h file down to minimum
{
public:...
private:...
bool bSapFunctionsAdded; // Easy enough to declare
};
bool CSapRfc::OnLogon() // .cpp file down to minimum
{
bSapFunctionsAdded = false; // this statement blows up!
}
Ken
|
|
|
|
|
What's the error message you are getting about that line?
|
|
|
|
|
Thank you for the response and question. However, I resolved it this morning by changeing from CSapRfc mSapRfc; to CSapRfc * new = CSapRfc; and associated changes. I suppose that is what I get from trying to work with a recent brain injury. Makes things much more difficult to see side issues.
ken
|
|
|
|
|
I was wondering if there was a way to scan for active IPs on a network. Thanks.
|
|
|
|
|
check NetServerEnum(), It can give the list of all workstations, if that is wot you are looking for.
suhredayan There is no spoon.
|
|
|
|
|
why don't you try in destructor of CPropertySheet
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Thanks, I figured out my own way to scan. It is not the best, but it works for me.
|
|
|
|
|
I begun programming...
And now should create somekind of addressbook...
I made some databases for it...
And now should get databases on grid...
But when I try to add "Microsoft FlexGrid..."
It gives some error about "...it requires design-license"
Someone help me!
:: Studing C++ ::
|
|
|
|