views:

19

answers:

1

http://www.adp-gmbh.ch/win/com/bho.html

When I compile, I get lots of errors:

error C2236: unexpected 'class' 'adpbho'. Did you forget a ';'?

error C3381: 'adpbho' : assembly access specifiers are only available in code compiled with a /clr option
..\adpbho.cpp(15) : error C3861: 'MB1': identifier not found
..\adpbho.cpp(24) : error C3861: 'MB1': identifier not found
..\adpbho.cpp(34) : error C3861: 'MB1': identifier not found
..\adpbho.cpp(85) : error C3861: 'MB1': identifier not found
..\adpbho.cpp(95) : error C2014: preprocessor command must start as first nonwhite space
..\adpbho.cpp(96) : error C2039: 'MB1' : is not a member of 'adpbho'
+1  A: 

Well, assuming you turned off your brain and just cut and pasted the garbage on that site, the first error is that this is not a valid way to declare a C++ class:

class BHO class adpbho : public IObjectWithSite, public IDispatch  {

There are two class statements. That's not allowed. It's probably supposed to be:

class adpbho : public IObjectWithSite, public IDispatch  {

The rest of the code is pretty horrible too. You're going to have to go line-by-line and clean it up, or find a better sample.

EDIT: The more I look at it the more bugs and errors I see. I highly recommend that you not use this code and instead find a better sample somewhere.

This has nothing to do specifically with BHO's or IE plugins and everything to do with basic C++ win32 programming, so I'll fix your tags.

jeffamaphone