Hi Everybody,
 
I am building a simple component with basic functionalities.
 
My code is:-
 
#include <stdio.h>
#include "nsIGenericFactory.h"
#ifndef MOZILLA_STRICT_API
#define MOZILLA_STRICT_API
#endif
#include "nsIModule.h"
#include "nsIFactory.h"
#include "nsIComponentManager.h"
#include "nsIComponentRegistrar.h"

#include "plstr.h"
#include "stdio.h"
#include "nsCOMPtr.h"
#include "nsMemory.h"
#define SAMPLE_CID \
{ 0x777f7150, 0x4a2b, 0x4301, \
{ 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa}}

class Sample: public nsISupports {   
public: 
  Sample(); 
  virtual ~Sample(); 

  NS_DECL_ISUPPORTS
}; 

Sample::Sample()  !

  // note: in newer versions of Gecko (1.3 or later)
  // you don't have to do this:
  NS_INIT_ISUPPORTS(); 

Sample::~Sample() 



NS_IMPL_ISUPPORTS(Sample, nsISupports);

NS_GENERIC_FACTORY_CONSTRUCTOR(Sample);

static const nsModuleComponentInfo components[] =
{
  { "Pretty Class Name",
    SAMPLE_CID,
    "@company.com/sample"
    SampleConstructor
  }
};

NS_IMPL_NSGETMODULE(nsSampleModule, components)
 
 
I am getting the error "nsISupports cannot instantiate abstract class due to member funtions Queryinterface, Addref,Release"
 
When i searched the implementation of these functions, i just got their declaration in nsISupportsbase.h ... Where is there implementation ??

Yahoo! India Matrimony: Find your life partner online.

Reply via email to