forcing __cdecl convention on member functions without variable arguments 
Author Message
 forcing __cdecl convention on member functions without variable arguments

Hi.

I'm trying to force a member function to use __cdecl and I keep getting
errors.

In the header file i have:

  void Blah(void *theArg);

I define the function as:

void CMyClass::Blah(void *theArg)
{
....

Quote:
}

Any attempts to force __cdecl to be used instead of thiscall causes errors.

Any thought on how to fix this?

Thanks so much,

Jeff



Mon, 20 May 2002 03:00:00 GMT  
 forcing __cdecl convention on member functions without variable arguments

Quote:

>Hi.

>I'm trying to force a member function to use __cdecl and I keep getting
>errors.

As well you should

Quote:
>In the header file i have:

>  void Blah(void *theArg);

That declares a globally scoped function,
not a class function.

Quote:
>I define the function as:

>void CMyClass::Blah(void *theArg)
>{
>....
>}

>Any attempts to force __cdecl to be used instead of thiscall causes errors.

Right; __cdecl makes no sense for a class member
function; a class member function requires the this *;
forcing __cdecl (if it were possible) would toss the
this * into the bit bucket, resulting in very bad things.

If you require compatibility with a callback or some such,
change the function to a static member function.



Mon, 20 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. forcing __cdecl on a class function

2. forcing __cdecl on a class function

3. static function access member variable and member function

4. Pointers to member functions as function arguments

5. How to pass a member function as inetrnal function pointer argument

6. member function and member variable

7. member function and member variable

8. member function and member variable

9. Calling convention for MFC class member functions

10. Newbie - function pointers to variable-argument-number function

11. Declaring class member variables that require a constructor argument

12. Calling conventions: __fastcall slower than __cdecl (MS VC++)

 

 
Powered by phpBB® Forum Software