Tech Support > Computers & Technology > Programming > How to use _stdcall for COM program
How to use _stdcall for COM program
Posted by Roof on June 13th, 2008


interface IX
{
virtual void _stdcall fx() = 0;
};

It can not compile.

Anybody good at COM programming here?

Posted by Greg Herlihy on June 13th, 2008


On Jun 12, 8:08*pm, Roof <roofali...@gmail.com> wrote:
I imagine that the problem here is that "interface" is not a keyword
in C++ (or C either). I believe that the COM headers have #define
like:

#define interface struct

which allows the above declaration to compile in C++.

Greg


Posted by Roof on June 13th, 2008


Yes, there's a <objbase.h> library, but that's not the point because I
have added it on.
The point is _stdcall, if I put it there I suffer a compile error...

Posted by Ben Bacarisse on June 13th, 2008


Roof <roofalison@gmail.com> writes:

You may need to ask in a compiler-specific group. Not all compilers
use the same syntax. I've __stdcall (note the double _) and
__attribute__((stdcall)) and I am sure there are others.

Search for stdcall in you compiler's documentation.

--
Ben.