Hi folks


Having problems compiling weblock2.php from the mozilla XPCOM ebook
any help would be very much appreciated.

I have followed the appendix in the book and configured the IDE for compiling xpcom modules and added an #include at the start of the file
to indicate where the gecko-sdk is on my hard disk but on attempting to compile i get the following inital errors from the compiler


It looks like its not understanding the macros are they defined in the gecko-sdk ??

Many thanks
Paul


Compiling...
weblock3.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\samplegeckoproject\weblock3.cpp(5) : error C2447: missing function header (old-style formal list?)
C:\Program Files\Microsoft Visual Studio\MyProjects\samplegeckoproject\weblock3.cpp(5) : error C2017: illegal escape sequence
C:\Program Files\Microsoft Visual Studio\MyProjects\samplegeckoproject\weblock3.cpp(14) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\Microsoft Visual Studio\MyProjects\samplegeckoproject\weblock3.cpp(14) : error C2501: 'NS_DECL_ISUPPORTS' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio\MyProjects\samplegeckoproject\weblock3.cpp(20) : error C2065: 'NS_INIT_ISUPPORTS' : undeclared identifier


the source code is as follows ...

#include "c:\gecko-sdk\mozilla-config.h"
#include "nsIGenericFactory.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)
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to