|
If you don't want the wizard created Menu at any time in your application then simply remove the IDR_MAINFRAME menu resource from your application. If you want to use it in some time then change the ID of the menu from IRD_MAINFRAME to some other
Do your Duty and Don't expect the Result
|
|
|
|
|
The compiler warns at the following
#include "StdAfx.h"
#include ".\sentencelist.h"
CSentenceList::CSentenceList(bool bCreateArray) : CSentenceArray(bCreateArray)
{ int x = NULL; //... this is where the compilation is interrupted
}
CSentenceList::~CSentenceList(void)
{
}
SentenceAr.h
#pragma once
#include <ostream>
using namespace std;
class CSentenceArray
// Sentences stored as an array
{ public:
CSentenceArray(bool bCreateArray);
virtual ~CSentenceArray(void);
void readFromFile (const char *pszFileName);
//void Display (ostream &Sentence);
void sortSentences(bool bAscending); // implements BubbleSort or quicksort
void Clear();
int FirstWord(const char *ptrWord);
int HowManyWords(const char *pszWord);
protected:
//virtual void storeSentence(const char *pszSentence);
//virtual const char *getNextSentence();
//virtual const char *peekNextSentence();
//virtual void swapWithNext();
//virtual void Reset();
//virtual void eraseAll();
private:
char *m_pSentences;
int m_iCurrentPos;
};
SentenceList.h
#pragma once
using namespace std;
#include "sentencear.h"
class CSentenceList :
// Sentences stored as a linked list
public CSentenceArray
{
public:
CSentenceList(bool bCreateArray);
virtual ~CSentenceList();
void deleteWord( const char *pszWord);
void printMaxSentences (ostream &out);
protected:
void CSentenceArray(bool bCreateArray);
virtual void storeSentence(const char *pszSentence);
virtual void swapWithNext();
virtual int HowManyWords(const char *pszWord);
};
Jon
|
|
|
|
|
there's no default constructor defined in your class. you should pass the bool value to the CSentenceArray class.
i.e the implementation code of CSentenceList constructor, you should pass teh bool value to as initialization list
CSentenceList::CSentenceList(bool bCreateArray) : CSentenceArray(bCreateArray)
{
}
hope it's clear
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Patte
-- modified at 11:28 Sunday 16th July, 2006
|
|
|
|
|
I think that's what I'm doing actually...
#include "StdAfx.h"
#include ".\sentencelist.h"
CSentenceList::CSentenceList(bool bCreateArray) : CSentenceArray(bCreateArray)
{//Code}
CSentenceList::~CSentenceList ()
{}
Error:
error C2512: 'CSentenceArray' : no appropriate default constructor available
error C2436: 'CSentenceArray' : member function or nested class in constructor initializer list
Jon
|
|
|
|
|
Make sure you have the equivalent of a default destructor by giving the parameters of your constructor default values. "C++ will not attempt to create a default constructor for you if you declare one" (Effective C++ Third Edition - Scott Meyers)
Try this in your declaration in the header file...
CSentenceList(bool bCreateArray=false);
|
|
|
|
|
I tried adding a default value, even in the base class, but it's still unsuccessful.
CSentenceList::CSentenceList(bool bCreateArray = false) : CSentenceArray(bCreateArray = false)
{int x = NULL;}
CSentenceList::~CSentenceList ()
{}
Jon
|
|
|
|
|
No, your putting it in the implementation section.
Put it only in the declaration in the header file.
|
|
|
|
|
jon_80 wrote:
I think that's what I'm doing actually...
Not per the code you've shown. The compiler is telling you exactly what the problem is. CSentenceArray has no default constructor.
class CSentenceArray
{
public:
CSentenceArray( void );
};
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You have declared a function called CSentenceArray in the CSentenceList class. I suspect this is hiding the CSentenceArray class constructor. Remove or rename this function, I'm pretty sure this is illegal anyway and you're just getting a poor diagnostic message from the compiler.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thats just passing the parameter to the base class which is correct, otherwise the base class will not get any parameters to initialize with. The class declaration shows CSentenceList is derived from CSentenceArray...
class CSentenceList :
// Sentences stored as a linked list
public CSentenceArray
-- modified at 12:57 Sunday 16th July, 2006
Oh crud, I just spotted what you were talking about. I missed that the first time around. You are right. That doesn't look quite right...
protected:
void CSentenceArray(bool bCreateArray);
virtual void storeSentence(const char *pszSentence);
virtual void swapWithNext();
virtual int HowManyWords(const char *pszWord);
};
-- modified at 13:01 Sunday 16th July, 2006
|
|
|
|
|
Hi everybody,
My question is how to convert this c++ code to javascript or html that can generate the result random number?
#include <cstdlib>
#include <ctime>
#include <iostream>
using std::cout;
int main( ) {
srand( ( unsigned )time( 0 ) );
int randomKey = rand() % 4013;
cout << "Your random key is: " << ( 10016486 + ( randomKey * 22423 ) ) << "\n";
system( "PAUSE" );
return 0;
}
Thanks for any help
|
|
|
|
|
Googling "javascript random" yields this[^] as the first result...
|
|
|
|
|
Hi,
i have developed COM componet,its a custom Component,it supports ConnectionPoints,the Conntection interface is dervied from IUnknown.In the Client Side i have imported tlb file,I have wrote class CSink:_ISampleEvents
CSink psink;
psink = new CSink;
the following error is occuring
error C2259: : cannot instantiate abstract class
why..? how to avoid it,what could be the reason?
Thanks in before
james
|
|
|
|
|
CSink psink; //should be CSink* psink?
you'd better check the class CSink and make sure that
the CSink impliment all the virtual functions whose it's drivied from
hi
|
|
|
|
|
An abstract class is one that has one or more pure virtual functions defined. The intent is that you derive from that class and provide actual implementations for each of these functions. You can't instantiate a class that has a pure virtual function defined (since if you called it, the computer wouldn't knnow what to do) so the error message you're getting indicates that you've missed (at least) one.
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
yeah i have overridden all the pure virtual function`s in the derived class,and wrote their implementation,even then i am getting error..
|
|
|
|
|
You have to check all the way up the hierarchy. Maybe you're deriving from a class that is derived from a class that is derived from a class that still has a pure virtual function
The error message is definitely caused by this (although vecodo_doon's comment may well be the cause as well).
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Have you implemented all of IUnknown 's methods?
If you're using ATL's support by deriving from CComObjectRoot(Ex), the class you declare is not complete - it still has some abstract methods. You have to make use of the CComObject family of templates (CComObject, CComAggObject, CComPolyObject, CComObjectStack) to actually create an instance. The ATL implementation of the class factory does this for you, depending on which DECLARE_AGGREGATABLE macro you used.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
if i want to get connected with server what r the minimum requirment.Other then port number what should i need.From where to start....
|
|
|
|
|
This is such an open-ended question it's hard to know what to do with it. What protocol do you want to use? What sort of server?
The only link I can give you is the Winsock Programmer's FAQ[^], which might help a little.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
|
You can connect to a remote machine (e.g., server) with a UNC path. Since you give no supporting information, a more detailed answer is not possible.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello,
I have a problem with more than one graph creation.
I added an element:
<br />
m_Graph.AddElement();<br />
than I wrote this line
<br />
m_Graph.PlotXY( i , pointsArray[i] ,arrIndex);<br />
the arrIndex=1
But it says that the element not found!
Here is a link to the article:
http://www.codeproject.com/miscctrl/ntgraph_activex.asp[^]
SnaidiS(Semion)
-- modified at 6:46 Sunday 16th July, 2006
|
|
|
|
|
please, I need some help
SnaidiS(Semion)
|
|
|
|
|
why nobody helps me?
SnaidiS(Semion)
|
|
|
|