Click here to Skip to main content
15,916,042 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Safer Timer Thread termination Pin
Doug Mitchell15-Oct-04 9:05
Doug Mitchell15-Oct-04 9:05 
GeneralRe: Safer Timer Thread termination Pin
Blake Miller15-Oct-04 9:38
Blake Miller15-Oct-04 9:38 
Generalconversion operator not being called for both objects Pin
lino_i15-Oct-04 6:53
lino_i15-Oct-04 6:53 
GeneralRe: conversion operator not being called for both objects Pin
David Crow15-Oct-04 8:09
David Crow15-Oct-04 8:09 
GeneralRe: conversion operator not being called for both objects Pin
lino_i15-Oct-04 8:37
lino_i15-Oct-04 8:37 
GeneralRe: conversion operator not being called for both objects Pin
David Crow15-Oct-04 9:03
David Crow15-Oct-04 9:03 
GeneralRe: conversion operator not being called for both objects Pin
lino_i15-Oct-04 9:25
lino_i15-Oct-04 9:25 
GeneralRe: conversion operator not being called for both objects Pin
David Crow15-Oct-04 9:46
David Crow15-Oct-04 9:46 
lino_i wrote:
why doesn't this line of code:

if (A != B) call:

bool operator!=(TestClass& sl) const
{
return Compare(m_Str, sl.m_Str);
}


This works fine for me:

class TestClass
{
    char *m_Str;
 
    bool Compare(const char *str1, const char *str2) const
    {
        return (strcmp(str1, str2) == 0);
    }
 
public:
 
    TestClass(){}
    ~TestClass(){}
 
    operator LPCTSTR() const    
    {        
        return m_Str;    
    }     
     
    bool operator!=(TestClass& s1) const    
    {        
        return Compare(m_Str, s1.m_Str);    
    }
};
lino_i wrote:
what's the point of the conversion operator?

If you needed to call a function or method that knew nothing about a TestClass object, but it did understand what a const char* was, it would be used in that context.


"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow


GeneralRe: conversion operator not being called for both objects Pin
lino_i15-Oct-04 9:50
lino_i15-Oct-04 9:50 
GeneralRe: conversion operator not being called for both objects Pin
David Crow15-Oct-04 9:59
David Crow15-Oct-04 9:59 
GeneralSkinned dialogs Pin
mtzlplyk15-Oct-04 6:14
mtzlplyk15-Oct-04 6:14 
Generalanalyzing the return value Pin
lino_i15-Oct-04 5:56
lino_i15-Oct-04 5:56 
GeneralRe: analyzing the return value Pin
mtzlplyk15-Oct-04 6:11
mtzlplyk15-Oct-04 6:11 
GeneralRe: analyzing the return value Pin
David Crow15-Oct-04 8:01
David Crow15-Oct-04 8:01 
QuestionHow do I gray out a radio button? Pin
tpbzdw15-Oct-04 5:13
tpbzdw15-Oct-04 5:13 
AnswerRe: How do I gray out a radio button? Pin
David Crow15-Oct-04 5:38
David Crow15-Oct-04 5:38 
GeneralRe: How do I gray out a radio button? Pin
tpbzdw15-Oct-04 5:41
tpbzdw15-Oct-04 5:41 
AnswerRe: How do I gray out a radio button? Pin
mtzlplyk15-Oct-04 6:04
mtzlplyk15-Oct-04 6:04 
GeneralRe: How do I gray out a radio button? Pin
tpbzdw15-Oct-04 11:35
tpbzdw15-Oct-04 11:35 
GeneralPicking in Opengl Pin
rage98915-Oct-04 5:06
rage98915-Oct-04 5:06 
GeneralDifferent techniques to handle license control Pin
anderslundsgard15-Oct-04 4:55
anderslundsgard15-Oct-04 4:55 
GeneralPlease help - individual chars in a CString Pin
...---...15-Oct-04 4:53
...---...15-Oct-04 4:53 
GeneralRe: Please help - individual chars in a CString Pin
David Crow15-Oct-04 5:39
David Crow15-Oct-04 5:39 
GeneralRe: Please help - individual chars in a CString Pin
...---...15-Oct-04 6:23
...---...15-Oct-04 6:23 
GeneralRe: Please help - individual chars in a CString Pin
David Crow15-Oct-04 6:37
David Crow15-Oct-04 6:37 

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.