Skip to main content
gamedev.net
🔒 Locked

Static member function

Started by Mihail121 1 reply 400+ views
Original Post
Mihail121
Mihail121
hello all.I seem to have a little problem here from this kind: i have a class to store all of the DDraw display modes for my software renderer:

class DispModeListDDraw : public DispModeList
{
private:
 
   static HRESULT WINAPI DDEnumModesProc(...);

public:

   DispModeListDDraw(void);
   ~DispModeListDDraw(void);

   bool Enum(DDrawDevice& device);
};

the problem is that i can''t call no other function from the DDEnumModesProc callback.C++ says i can''t call function from static member or something like that.Can anyone help me please? http://mihail121.tripod.com
Fruny
Fruny
You can''t call a non-static member function from a static member function unless you give it an object to work on.


[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Mihail121
Mihail121
Gee i''m dumb!!!!!!!!!!!Of course not!Thanks for reminding me pal.I''ve found to pass the reference to the current class("this") within the context in the enumeration function.Now it works allright!You saved my life twice today!10x

http://mihail121.tripod.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.