Solved

Simple Header probllem

Posted on 2003-10-28
2
213 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

713 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