Click here to Skip to main content
16,012,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMFC without a dialog or view? Pin
8-Dec-00 14:08
suss8-Dec-00 14:08 
AnswerRe: MFC without a dialog or view? Pin
Erik Funkenbusch8-Dec-00 18:03
Erik Funkenbusch8-Dec-00 18:03 
GeneralRe: MFC without a dialog or view? Pin
8-Dec-00 19:23
suss8-Dec-00 19:23 
GeneralRe: MFC without a dialog or view? Pin
Erik Funkenbusch8-Dec-00 21:58
Erik Funkenbusch8-Dec-00 21:58 
GeneralRe: MFC without a dialog or view? Pin
10-Dec-00 21:46
suss10-Dec-00 21:46 
GeneralRe: MFC without a dialog or view? Pin
Erik Funkenbusch11-Dec-00 12:17
Erik Funkenbusch11-Dec-00 12:17 
GeneralMinimized Window doesnot show up Pin
8-Dec-00 9:38
suss8-Dec-00 9:38 
GeneralHelp with string class - return char * Pin
Christian Graus7-Dec-00 12:04
protectorChristian Graus7-Dec-00 12:04 
Hi all. I'm trying to write a string class ( we want to move away from MFC as we want to develop a cross platform product ), and I am starting by deriving from the standard string class. My header looks like this:

#include <string>

using namespace std;

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000



class CGString : public virtual string
{
public:
CGString();
virtual ~CGString();

};

My problem is, I want to do this:

CGString s;
s = "dfdsfs";
printf(s);

And it's telling me = is not defined for this input type, and that it cannot convert from CGString to char*. I'm not sure *why* I need to provide the operator= again, but that's cool. I want to know how I can make my variable return a char*, in essence to cast itself to it's data member ? I know I can use .GetBuffer() or whatever, but I don't want to, if I can avoid it.

Thanks for helping...

Christian

The content of this post is not necessarily the opinion of my yadda yadda yadda.

To understand recursion, we must first understand recursion.
GeneralRe: Help with string class - return char * Pin
Michael Dunn7-Dec-00 13:35
sitebuilderMichael Dunn7-Dec-00 13:35 
GeneralRe: Help with string class - return char * Pin
Christian Graus7-Dec-00 14:04
protectorChristian Graus7-Dec-00 14:04 
GeneralRe: Help with string class - return char * Pin
Erik Funkenbusch8-Dec-00 10:20
Erik Funkenbusch8-Dec-00 10:20 
GeneralRe: Help with string class - return char * Pin
Christian Graus8-Dec-00 12:22
protectorChristian Graus8-Dec-00 12:22 
GeneralRe: Help with string class - return char * Pin
Erik Funkenbusch8-Dec-00 18:25
Erik Funkenbusch8-Dec-00 18:25 
GeneralRe: Help with string class - return char * Pin
Christian Graus9-Dec-00 9:42
protectorChristian Graus9-Dec-00 9:42 
GeneralRe: Help with string class - return char * Pin
Erik Funkenbusch9-Dec-00 12:54
Erik Funkenbusch9-Dec-00 12:54 
GeneralRe: Help with string class - return char * Pin
Christian Graus9-Dec-00 21:28
protectorChristian Graus9-Dec-00 21:28 
GeneralRe: Help with string class - return char * Pin
Erik Funkenbusch11-Dec-00 12:25
Erik Funkenbusch11-Dec-00 12:25 
GeneralRe: Help with string class - return char * Pin
Christian Graus8-Dec-00 12:58
protectorChristian Graus8-Dec-00 12:58 
GeneralRe: Help with string class - return char * Pin
Erik Funkenbusch8-Dec-00 18:26
Erik Funkenbusch8-Dec-00 18:26 
Generaldisable one ActiveX function Pin
7-Dec-00 7:57
suss7-Dec-00 7:57 
GeneralRe: disable one ActiveX function Pin
SAWilde7-Dec-00 23:03
SAWilde7-Dec-00 23:03 
GeneralRe: disable one ActiveX function Pin
8-Dec-00 6:23
suss8-Dec-00 6:23 
GeneralDesktop icons and their labels Pin
Daníel B. Sigurgeirsson7-Dec-00 4:46
Daníel B. Sigurgeirsson7-Dec-00 4:46 
GeneralRe: Desktop icons and their labels Pin
Christian Graus7-Dec-00 12:07
protectorChristian Graus7-Dec-00 12:07 
GeneralRe: Desktop icons and their labels Pin
Daníel B. Sigurgeirsson11-Dec-00 0:17
Daníel B. Sigurgeirsson11-Dec-00 0:17 

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.