Solved

Simple Header probllem

Posted on 2003-10-28
2
216 Views
Last Modified: 2008-02-26
why isn't this working?

.h file:
#include "stdafx.h"

class ContactInfo
{
public:
      ContactInfo();
      ~ContactInfo();

      bool initalized;
      int singleMessagesSentTo ;
      int singleMesssagesReceivedFrom;
      int multiMessagesSentTo;
      int multiMessagesReceivedFrom;
      char* lastSentSubject;
      char* lastReceivedSubject;
      SYSTEMTIME *lastSentDate;
      SYSTEMTIME *lastReceivedDate;
}

.cpp file

#include "stdafx.h"
#include "ContactInfo.h"

ContactInfo::ContactInfo(void)
{
      initalized = true;
      singleMessagesSentTo = 0;
      singleMesssagesReceivedFrom = 0;
      multiMessagesSentTo = 0;
      multiMessagesReceivedFrom = 0;
      lastSentSubject = NULL;
      lastReceivedSubject = NULL;
      lastSentDate = NULL;
      lastReceivedDate = NULL;
}

ContactInfo::~ContactInfo(void)
{
}
error C2533: 'ContactInfo::__ctor' : constructors not allowed a return type

Error:  
0
Comment
Question by:jjacksn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 4

Expert Comment

by:n_fortynine
ID: 9639397
>>#include "stdafx.h"
you meant #include <stdafx.h> since this is an MFC standard header...
0
 
LVL 4

Accepted Solution

by:
n_fortynine earned 150 total points
ID: 9639409
and don't forget the ; after declaring a class
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question