OLE 2.0 and G++ (fwd)

Eric Britten ebritten@ea.oac.uci.edu
Fri Apr 11 14:21:00 GMT 1997


I was trying to compile a shell extension example from microsoft and ran
into a few problems.  I recieved errors and warnings that I did not like.
I am using the headers provided by the Platform SDK from Microsoft.

The shell extensions used C++ classes, not the C structures.

The warnings that bothered me came from the virtual member functions of
all the Interfaces in the ole 2.0 headers.

For example, an interface in a generic file called file.cpp:

class IFoo
{
public:
  void __stdcall Bar() = 0;		//4
  void * __stdcall BarPtr() = 0;  	//5
};

On line 4 I would receive a warning like:

file.cpp:4: warning:  attribute directive ignored

I know that __stdcall expands to __attribute__((stdcall)).  All OLE
functions and interfaces use the __stdcall convention.  I am worried that
since the attribute directive is ignored that the __stdcall convention
will be ignored, and the __cdecl convention will be used instead.  I doubt
that the two conventions are compatible.  Can Class member functions be
__stdcall.  I determined that the fact that the function is pure virtual
is not relavent.

The errors that I received were something like
file.cpp:5: syntax error before __attribute__.  Using trial and error I
found that if the pointer '*' is placed after the __stdcall then there is
no error.  Why would it make a difference if the function had:

void * __stdcall BarPtr() 
-or-
void __stdcall * BarPtr()
?

There is a chance that I have this reversed, I can't check right now.
 
And lastly is it possible to export a C++ class, its member data, or its
member functions from a dll?  It it possible to export a function that is
in a c++ module that is not 'extern "C"'?


Eric Britten
------------------------------------------------------
------------------------------------------------------


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list