Solved

Simple Header probllem

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

932 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now