mfc >> why is this class abstract?!

by Edward Walker » Mon, 24 Nov 2003 22:45:38 GMT

i have looked all over this class and cant figure out why its abstract.
below are the header files for it. the first one is a regular class called
CCeFileFilterSite, which is derived from an interface called
ICeFileFilterSite (it's header file is below the CCeFileFilterSite header
file) which is derrived from IUnknown. i've been looking at this code for
days and cant figure out why CCeFileFilterSite is abstract.

thanks for any help you can give me,
edward

CCeFileFilterSite header file:
#pragma once

#include "ICeFileFilterSite.h"

class CCeFileFilterSite : public ICeFileFilterSite

{

public:

CCeFileFilterSite(void);

~CCeFileFilterSite(void);

virtual HRESULT OpenSourceFile(int nHowToOpenFile, LPVOID* ppObj);

virtual HRESULT OpenDestinationFile(int nHowToOpenFile, LPCTSTR pszFullpath,
LPVOID* ppObj);

virtual HRESULT CloseSourceFile(LPUNKNOWN pObj);

virtual HRESULT CloseDestinationFile(BOOL bKeepFile, LPUNKNOWN pObj);

virtual HRESULT ReportProgress(UINT nPercent);

virtual HRESULT ReportLoss(DWORD dw, LPCTSTR psz, va_list args);

};



ICeFileFilterSite header file:

#pragma once

// {6C5C05E0-97A2-11cf-8011-00A0C90A8F78}

DEFINE_GUID(IID_ICeFileFilterSite,

0x6c5c05e0, 0x97a2, 0x11cf, 0x80, 0x11, 0x0, 0xa0, 0xc9, 0xa, 0x8f, 0x78);

//

// ICeFileFilterSite interface provided by Windows CE Services

//

#undef INTERFACE

#define INTERFACE ICeFileFilterSite

//DECLARE_INTERFACE_(ICeFileFilterSite, IUnknown)

interface ICeFileFilterSite : public IUnknown

{

// *** ICeFileFilterSite methods ***

virtual HRESULT OpenSourceFile(int nHowToOpenFile, LPVOID *ppObj);

virtual HRESULT OpenDestinationFile(int nHowToOpenFile, LPCTSTR pszFullpath,
LPVOID *ppObj);

virtual HRESULT CloseSourceFile(LPUNKNOWN pObj);

virtual HRESULT CloseDestinationFile(BOOL bKeepFile, LPUNKNOWN pObj);

virtual HRESULT ReportProgress(UINT nPercent);

virtual HRESULT ReportLoss(DWORD dw, LPCTSTR psz, va_list args);

};




mfc >> why is this class abstract?!

by Doug Harrison [MVP] » Tue, 25 Nov 2003 00:45:50 GMT






Are the IUnknown members implemented?

--
Doug Harrison
Microsoft MVP - Visual C++



mfc >> why is this class abstract?!

by Edward Walker » Tue, 25 Nov 2003 08:45:03 GMT

sometimes its the obvious that will kill you. no they're not.

thanks alot,
edward





called
for




Similar Threads

1. Why an Abstract Base Class cannot be instantiated ?

Hello,

Why an Abstract Base Class cannot be instantiated ?

Does anybody know of the object construction internals ?

What is the missing information that prevents the construction ?

TIA.
Dev

2. what is abstract class and abstract method - CSharp/C#

3. Abstract members in non-abstract classes?

Is is legal to declare abstract members in non-abstract classes? How about
non-abstract members in abstract classes?

I am writing a base class with three derived classes. The base class will
define the behavior for most, but not all of its members. The derived
classes will define the behavior for the remaining members (the undefined
members).

I'd like to force the derived classes to implement the undefined members in
the base class. I assumed that I could simply declare those members as
abstract. But I'm getting a compiler error that says I can't declare
abstract members in a non-abstract class. If I declare the base class as an
abstract class, the compiler won't let me define the behavior of the
concrete members in the base class.

This looks like an all-or-nothing proposition to me. If I declare a class as
abstract, all its members must be abstract, and if I don't declare the class
as abstract, it can't have any abstract members. Is that correct? If so,
what's the rationale? It seems awfully inflexible, so I figure there must be
a good reason for it. Thanks

-- 
Dave Veeneman
Chicago


4. Abstract class with no abstract functions

5. Static Constructor of Abstract class and Derived Classes

Is there a way (using Reflection or anything else) to know what derived class 
caused a static contructor to be called?

6. About the abstract class TextReader and the normal StreamReader class - CSharp/C#

7. Derived classes of an abstract class - adding methods.

I have an abstract class with some abstract methods.  I created
another class that derives from the abstract method.  In the derived
class I have overridden all the abstract methods.  However, I tried to
create a method in the class that doesn't exist in the abstract class
and I get a compile error that says the method cannot be found in the
abstract class.

Am I to understand that I cannot add any additional methods to the
derived class and that I can only use methods that are in the abstract
classes?

8. abstract class, implementing virtual class loaded at runtime - CSharp/C#