Click here to Skip to main content
15,920,632 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: reduce size of CFileDialog Pin
RaajaOfSelf21-Oct-05 7:52
RaajaOfSelf21-Oct-05 7:52 
GeneralRe: reduce size of CFileDialog Pin
bugDanny21-Oct-05 8:08
bugDanny21-Oct-05 8:08 
GeneralRe: reduce size of CFileDialog Pin
RaajaOfSelf21-Oct-05 10:18
RaajaOfSelf21-Oct-05 10:18 
GeneralRe: reduce size of CFileDialog Pin
bugDanny21-Oct-05 11:18
bugDanny21-Oct-05 11:18 
GeneralRe: reduce size of CFileDialog Pin
FarPointer22-Oct-05 1:30
FarPointer22-Oct-05 1:30 
GeneralRe: reduce size of CFileDialog Pin
bugDanny24-Oct-05 8:32
bugDanny24-Oct-05 8:32 
GeneralRe: reduce size of CFileDialog Pin
RaajaOfSelf23-Oct-05 16:57
RaajaOfSelf23-Oct-05 16:57 
QuestionNew class Pin
bugDanny20-Oct-05 5:28
bugDanny20-Oct-05 5:28 
I'm trying to write a new class that is a derivative of CObject. The code all looks fine to me, but when I try to compile I get an error saying "constructor not allowed a return type", but I'm not trying to put a return type, or a return statement. Here's the code.
In ClassNameOb.cpp:
#include "stdafx.h"
#include "ClassNameOb.h"
ClassName::ClassName()
{
   m_var->VarOne = m_var->VarTwo = m_var->VarThree = m_var->VarFour = m_var->VarFive = -1;
   m_otherVar = -1;
}
ClassName::~ClassName(){}
In ClassNameOb.h:
class ClassName : public CObject
{
protected:
   struct structType
   {
      int VarOne;
      int VarTwo;
      int VarThree;
      int VarFour;
      int VarFive;
   }*m_var;
   int m_otherVar;
public:
   ClassName();
   ~ClassName();
}

And then I get an error pointing to the line with the first { bracket of the constructor saying, "constructors not allowed a return type".

Why am I getting this error when I'm not even trying to return anything?

Danny

The stupidity of others amazes me!
AnswerRe: New class Pin
David Crow20-Oct-05 5:44
David Crow20-Oct-05 5:44 
GeneralRe: New class Pin
bugDanny20-Oct-05 6:02
bugDanny20-Oct-05 6:02 
GeneralRe: New class Pin
S. Senthil Kumar20-Oct-05 6:03
S. Senthil Kumar20-Oct-05 6:03 
GeneralRe: New class Pin
bugDanny20-Oct-05 6:08
bugDanny20-Oct-05 6:08 
GeneralRe: New class Pin
S. Senthil Kumar21-Oct-05 1:48
S. Senthil Kumar21-Oct-05 1:48 
GeneralRe: New class Pin
bugDanny21-Oct-05 2:45
bugDanny21-Oct-05 2:45 
QuestionWM_MOUSEMOVE Child Window Pin
nermsk20-Oct-05 4:06
nermsk20-Oct-05 4:06 
AnswerRe: WM_MOUSEMOVE Child Window Pin
Mircea Puiu20-Oct-05 4:43
Mircea Puiu20-Oct-05 4:43 
GeneralRe: WM_MOUSEMOVE Child Window Pin
nermsk20-Oct-05 7:33
nermsk20-Oct-05 7:33 
GeneralRe: WM_MOUSEMOVE Child Window Pin
Mircea Puiu20-Oct-05 8:11
Mircea Puiu20-Oct-05 8:11 
AnswerRe: WM_MOUSEMOVE Child Window Pin
TheJonzer20-Oct-05 10:00
TheJonzer20-Oct-05 10:00 
QuestionCStatic derived class Pin
cedric_craze20-Oct-05 4:04
cedric_craze20-Oct-05 4:04 
AnswerRe: CStatic derived class Pin
Cedric Moonen20-Oct-05 4:15
Cedric Moonen20-Oct-05 4:15 
AnswerRe: CStatic derived class Pin
Mircea Puiu20-Oct-05 4:27
Mircea Puiu20-Oct-05 4:27 
GeneralRe: CStatic derived class Pin
cedric_craze20-Oct-05 5:32
cedric_craze20-Oct-05 5:32 
GeneralRe: CStatic derived class Pin
Mircea Puiu20-Oct-05 5:36
Mircea Puiu20-Oct-05 5:36 
GeneralRe: CStatic derived class Pin
cedric_craze20-Oct-05 5:48
cedric_craze20-Oct-05 5:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.