Solved

Simple Header probllem

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

821 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