Click here to Skip to main content
15,909,193 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDoes PeekMessage() always cause an infinite loop? Pin
Joseph Marzbani6-Dec-08 9:50
Joseph Marzbani6-Dec-08 9:50 
AnswerRe: Does PeekMessage() always cause an infinite loop? Pin
Code-o-mat6-Dec-08 10:07
Code-o-mat6-Dec-08 10:07 
AnswerRe: Does PeekMessage() always cause an infinite loop? Pin
Randor 6-Dec-08 11:13
professional Randor 6-Dec-08 11:13 
Questioni can't add a CArray member to a class !!! error c2248 !!! Pin
aliusam6-Dec-08 6:44
aliusam6-Dec-08 6:44 
AnswerRe: i can't add a CArray member to a class !!! error c2248 !!! Pin
Jijo.Raj6-Dec-08 9:33
Jijo.Raj6-Dec-08 9:33 
GeneralRe: i can't add a CArray member to a class !!! error c2248 !!! Pin
aliusam6-Dec-08 10:56
aliusam6-Dec-08 10:56 
GeneralRe: i can't add a CArray member to a class !!! error c2248 !!! Pin
Jijo.Raj6-Dec-08 11:06
Jijo.Raj6-Dec-08 11:06 
GeneralRe: i can't add a CArray member to a class !!! error c2248 !!! Pin
aliusam7-Dec-08 22:23
aliusam7-Dec-08 22:23 
hiii

this is the header:
#pragma once
#include "ga_dna.h"
#include "afxtempl.h"

#define NoOf_cValues		20
#define NoOf_rValues		51


class GA_Individual
{
public:
	GA_Individual(void);
public:
	virtual ~GA_Individual(void);
public:
	GA_DNA dna1;
           .
           .
           .
           .
           .
	// constructors
	GA_Individual(GA_DNA* pDNA);
	
	static unsigned short c[NoOf_cValues];
	static unsigned short r[NoOf_rValues];
public:
	// always call this function befor using the class to initialize it
	static bool initIndiv(void);


	CArray <CString> opamp;        //tried "	CArray <CString,CString&> opamp;
" and the same
};


the .cpp is like:
#include "StdAfx.h"
#include "GA_Individual.h"
//#define _CRT_RAND_S		// required to use rand_s()	// defined in the compiler comand line
#include "stdlib.h"
#include "windows.h"

#include <tchar.h>
#include <math.h>

unsigned short GA_Individual::c[NoOf_cValues];
unsigned short GA_Individual::r[NoOf_rValues];

GA_Individual::GA_Individual(void)
: Age(0)
{
	CArray <CString> opamp(void);   // i tried this line but it did not solve a thing
}

GA_Individual::~GA_Individual(void)
{
}

GA_Individual::GA_Individual(GA_DNA* pDNA)
{
......
}

bool GA_Individual::initIndiv(void)
{
......
}
.
....... other function definitions here
.




i noticed a thing, if i make the array a ststic ( static CArray <cstring> opamp; ) member the code compiles, i can use it as a static with few axtra lines, but i am thinking what if using it as static was not an option, one should be able to add any type to the class, right, even if it did not have the operator '=' ???

Ali Usam AlCherchefchi

AnswerRe: i can't add a CArray member to a class !!! error c2248 !!! Pin
Richard Andrew x646-Dec-08 15:13
professionalRichard Andrew x646-Dec-08 15:13 
GeneralRe: i can't add a CArray member to a class !!! error c2248 !!! Pin
aliusam7-Dec-08 22:42
aliusam7-Dec-08 22:42 
AnswerRe: i can't add a CArray member to a class !!! error c2248 !!! Pin
Snorri Kristjansson7-Dec-08 0:44
professionalSnorri Kristjansson7-Dec-08 0:44 
GeneralRe: i can't add a CArray member to a class !!! error c2248 !!! Pin
aliusam7-Dec-08 22:34
aliusam7-Dec-08 22:34 
GeneralRe: i can't add a CArray member to a class !!! error c2248 !!! Pin
Snorri Kristjansson8-Dec-08 5:57
professionalSnorri Kristjansson8-Dec-08 5:57 
GeneralRe: i can't add a CArray member to a class !!! error c2248 !!! Pin
aliusam9-Dec-08 11:42
aliusam9-Dec-08 11:42 
QuestionProcess Pin
messages6-Dec-08 3:21
messages6-Dec-08 3:21 
AnswerRe: Process Pin
Jijo.Raj6-Dec-08 4:36
Jijo.Raj6-Dec-08 4:36 
AnswerRe: Process Pin
Mark Salsbery6-Dec-08 6:02
Mark Salsbery6-Dec-08 6:02 
Questioncreate x64 support ocx in visual c++ 6 Pin
samira forooghi5-Dec-08 23:18
samira forooghi5-Dec-08 23:18 
AnswerRe: create x64 support ocx in visual c++ 6 Pin
Hamid_RT6-Dec-08 4:16
Hamid_RT6-Dec-08 4:16 
AnswerRe: create x64 support ocx in visual c++ 6 Pin
Hadi Dayvary6-Dec-08 8:11
professionalHadi Dayvary6-Dec-08 8:11 
GeneralRe: create x64 support ocx in visual c++ 6 [modified] Pin
samira forooghi6-Dec-08 20:00
samira forooghi6-Dec-08 20:00 
AnswerRe: create x64 support ocx in visual c++ 6 Pin
Hamid_RT7-Dec-08 17:50
Hamid_RT7-Dec-08 17:50 
QuestionHow can i get text from CRichEditCtrl Pin
york5285-Dec-08 19:36
york5285-Dec-08 19:36 
AnswerRe: How can i get text from CRichEditCtrl Pin
Code-o-mat6-Dec-08 2:14
Code-o-mat6-Dec-08 2:14 
GeneralRe: How can i get text from CRichEditCtrl Pin
york5286-Dec-08 4:08
york5286-Dec-08 4:08 

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.