Click here to Skip to main content
15,845,681 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString Concatenation question Pin
ForNow21-Jul-16 12:59
ForNow21-Jul-16 12:59 
GeneralRe: CString Concatenation question Pin
Saravanan Sundaresan24-Sep-16 21:07
professionalSaravanan Sundaresan24-Sep-16 21:07 
Question__interface keyword not practicable when derived class exports to dll? Pin
FriendOfAsherah21-Jul-16 0:17
FriendOfAsherah21-Jul-16 0:17 
Questionhow to make steganography in C++ Pin
jhonganteng20-Jul-16 22:35
jhonganteng20-Jul-16 22:35 
AnswerRe: how to make steganography in C++ Pin
CPallini20-Jul-16 23:14
mveCPallini20-Jul-16 23:14 
GeneralRe: Sorry? What is the operator 'shift up' (and 'shift down'?)? Pin
jhonganteng21-Jul-16 5:50
jhonganteng21-Jul-16 5:50 
AnswerRe: how to make steganography in C++ Pin
leon de boer21-Jul-16 2:57
leon de boer21-Jul-16 2:57 
Questionerror 2039 {dtor} is not element of ImyInterface - when does this happen? Pin
FriendOfAsherah20-Jul-16 21:23
FriendOfAsherah20-Jul-16 21:23 
I have declared a simpl interface using

C++
__interface ImyInterface
{
   virtual Method1() abstract;
   virtual Method2() abstract;
};
class MyClass : public ImyInterface, public CBase
{
public:
   MyClass();
   virtual ~MyClass();
   virtual Method1();
   virtual Method2();

protected:
   int member1, member2; 
};


This is implemented in big code where I use downcasts like
C++
CBase* ptr = new CMyClass();
dynamic_cast<ImyInterface*>(ptr);

and some other typecasting of ImyInterface* found only by "search complete project"

on one hand destructors are not allowed in an Interface because __interface uses __declspec(novtable)
on the other hand the compiler wants to have a destructor
(error is shown at "}" of the derived class)

What constructs in the code will force the compile to raise this error, and, is the usage of __interface in c++ too special for interfaces and I should use struct only?.

In common: when never use interface as a base of a class?

modified 21-Jul-16 2:57am.

AnswerRe: error 2039 {dtor} is not element of ImyInterface - when does this happen? Pin
FriendOfAsherah20-Jul-16 23:54
FriendOfAsherah20-Jul-16 23:54 
Questionprotected access specifier Pin
kinderu19-Jul-16 5:52
kinderu19-Jul-16 5:52 
AnswerRe: protected access specifier Pin
Richard MacCutchan19-Jul-16 6:29
mveRichard MacCutchan19-Jul-16 6:29 
GeneralRe: protected access specifier Pin
kinderu19-Jul-16 7:31
kinderu19-Jul-16 7:31 
GeneralRe: protected access specifier Pin
Richard MacCutchan19-Jul-16 8:02
mveRichard MacCutchan19-Jul-16 8:02 
QuestionRe: protected access specifier Pin
David Crow19-Jul-16 18:39
David Crow19-Jul-16 18:39 
AnswerRe: protected access specifier Pin
kinderu20-Jul-16 1:05
kinderu20-Jul-16 1:05 
QuestionRe: protected access specifier Pin
David Crow20-Jul-16 3:53
David Crow20-Jul-16 3:53 
QuestionRe: protected access specifier Pin
Richard MacCutchan20-Jul-16 23:01
mveRichard MacCutchan20-Jul-16 23:01 
AnswerRe: protected access specifier Pin
kinderu21-Jul-16 2:31
kinderu21-Jul-16 2:31 
GeneralRe: protected access specifier Pin
Richard MacCutchan21-Jul-16 2:36
mveRichard MacCutchan21-Jul-16 2:36 
QuestionDebug COM DLL from ASP.Net Pin
Member 741142218-Jul-16 3:00
Member 741142218-Jul-16 3:00 
QuestionInheritance classes Pin
kinderu16-Jul-16 21:32
kinderu16-Jul-16 21:32 
AnswerRe: Inheritance classes Pin
Daniel Pfeffer16-Jul-16 21:45
professionalDaniel Pfeffer16-Jul-16 21:45 
AnswerRe: Inheritance classes Pin
Albin George18-Jul-16 2:14
Albin George18-Jul-16 2:14 
QuestionUnmanaged DLL used by C# WPF app not receiving WM_DEVICECHANGE Pin
Leif Simon Goodwin15-Jul-16 4:07
Leif Simon Goodwin15-Jul-16 4:07 
QuestionRe: Unmanaged DLL used by C# WPF app not receiving WM_DEVICECHANGE Pin
David Crow15-Jul-16 6:59
David Crow15-Jul-16 6:59 

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.