From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Britten To: cygnus Subject: OLE 2.0 and G++ Date: Mon, 07 Apr 1997 12:38:00 -0000 Message-id: References: <199704061544.IAA01179@nz1.netzone.com> X-SW-Source: 1997-04/msg00134.html 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: 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 -or- void __stdcall * ? 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, send a message to "gnu-win32-request@cygnus.com" with one line of text: "help".