iilegal call of non-static member function 
Author Message
 iilegal call of non-static member function

Hi,

in my MFC-Application I'm using a callback function
of a third party library (ssl) that can only call a
static function, so that all functions I call within
the static function must also be static. That's not
a problem for my self-written functions, but how
could I pop up a MessageBox. I got the error:

Compiler Error C2352
'class::function' : illegal call of non-static member function

bye

        Norbert



Tue, 06 Apr 2004 02:08:53 GMT  
 iilegal call of non-static member function


Quote:
> Hi,

> in my MFC-Application I'm using a callback function
> of a third party library (ssl) that can only call a
> static function, so that all functions I call within
> the static function must also be static. That's not
> a problem for my self-written functions, but how
> could I pop up a MessageBox. I got the error:

> Compiler Error C2352
> 'class::function' : illegal call of non-static member function

> bye

> Norbert

Hmm, use the global AfxMessageBox() instead ?

Lucian



Mon, 05 Apr 2004 19:21:16 GMT  
 iilegal call of non-static member function
or the API messagebox
::MessageBox()

James


Quote:


message

> > Hi,

> > in my MFC-Application I'm using a callback function
> > of a third party library (ssl) that can only call a
> > static function, so that all functions I call within
> > the static function must also be static. That's not
> > a problem for my self-written functions, but how
> > could I pop up a MessageBox. I got the error:

> > Compiler Error C2352
> > 'class::function' : illegal call of non-static member function

> > bye

> > Norbert

> Hmm, use the global AfxMessageBox() instead ?

> Lucian



Mon, 05 Apr 2004 20:42:18 GMT  
 iilegal call of non-static member function
Note that if you call the API funciton, you had better have a parent
HWND to associate it with; NULL HWND is an invitation to disaster,
because the messagebox can now fall underneath your app and be
invisible (since it is owned by the desktop).
::MessageBox(AfxGetMainWnd()->m_hWnd, ...)
should solve it.
                        joe

On Thu, 18 Oct 2001 13:42:18 +0100, "James Screech"

Quote:

>or the API messagebox
>::MessageBox()

>James




>message

>> > Hi,

>> > in my MFC-Application I'm using a callback function
>> > of a third party library (ssl) that can only call a
>> > static function, so that all functions I call within
>> > the static function must also be static. That's not
>> > a problem for my self-written functions, but how
>> > could I pop up a MessageBox. I got the error:

>> > Compiler Error C2352
>> > 'class::function' : illegal call of non-static member function

>> > bye

>> > Norbert

>> Hmm, use the global AfxMessageBox() instead ?

>> Lucian

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Tue, 06 Apr 2004 04:53:57 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. illegal call of non-static member function

2. illegal call of non-static member function

3. illegal call of non-static member function *HELP*

4. illegal call of non-static member function

5. Illegal call of non-static member function (error)?

6. illegal call of non-static member function

7. Error C2352 - illegal call of non-static member function

8. Compiler Error C2352: illegal call of non-static member function

9. illegal call of non-static member function

10. One Problem in Calling Static function from Non static function

11. Getting pointer to non-static member function from C callback function

12. Using Non-Static Callback Functions as member Functions VC5.0

 

 
Powered by phpBB® Forum Software