Solved

Simple Header probllem

Posted on 2003-10-28
2
205 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
Comment Utility
>>#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
Comment Utility
and don't forget the ; after declaring a class
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

771 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

10 Experts available now in Live!

Get 1:1 Help Now