a little problem i face when creating a variable..

  • Thread starter Thread starter Guest
  • Start date Start date
OK, CDSEncoder is your class name, correct?
And, you wish to add a protected member variable to your class definition
using the name m_encoder?
If I'm guessing right so far, you're actually attempting to instantiate an
object of type CDSEncoder before finishing the class definition, thus the
compiler is complaining that it has not yet detected the end of the class
definition (denoted by a ; following a }).
Basically, AFAIK (and I'm confident I'll be corrected if I'm wrong) you
cannot create an object of the class being defined as a member variable of
that class.
 
Peter van der Goes said:
OK, CDSEncoder is your class name, correct?
And, you wish to add a protected member variable to your class definition
using the name m_encoder?
If I'm guessing right so far, you're actually attempting to instantiate an
object of type CDSEncoder before finishing the class definition, thus the
compiler is complaining that it has not yet detected the end of the class
definition (denoted by a ; following a }).
Basically, AFAIK (and I'm confident I'll be corrected if I'm wrong) you
cannot create an object of the class being defined as a member variable of
that class.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.

CDSEncoder is a wrapper class i found in 1 of the sample program... and now i need to create an object of that in KNNDlg.cpp so as to call the functions there... so how can i do it? u mean i cant jus write CDSEncoder m_encoder; ?
 
now i need to create an object of that in KNNDlg.cpp so as to call the
functions there... so how can i do it? u mean i cant jus write CDSEncoder
m_encoder; ?
Have you included the CDSEncoder class header in your program?
The class needs to be available to your program. Is that class defined as
part of the sample program?
 
Back
Top