Boost logo

Boost Users :

Subject: [Boost-users] Boost Bind
From: Etienne Pretorius (icewolfhunter_at_[hidden])
Date: 2010-03-02 02:12:50


Hello List,

I am trying to use boost::signals with boost bind... but I always get
this compiler error:

1>c:\program files\boost\boost_1_42\boost\bind\bind.hpp(69) : error
C2825: 'F': must be a class or namespace when followed by '::'
1> c:\program
files\boost\boost_1_42\boost\bind\bind_template.hpp(15) : see reference
to class template instantiation 'boost::_bi::result_traits<R,F>' being
compiled
1> with
1> [
1> R=boost::_bi::unspecified,
1> F=__w64 long (__stdcall ticketman::Window::*
)(UINT,WPARAM,LPARAM)
1> ]

I am unable to make sence of it...

/*CODE*/

     /* boost::signal masqurading as a Window Procedure */
     static boost::signal<::LRESULT (::HWND,::UINT,::WPARAM,::LPARAM)>
WindowProc;

     /* Window Procedure */
     ::LRESULT CALLBACK WndProc(
         ::HWND hWnd,
         ::UINT message,
         ::WPARAM wParam,
         ::LPARAM lParam
     ) {
         return WindowProc(hWnd, message, wParam, lParam);
     };

     class Window
         : public boost::noncopyable {
     public:
         /* Deconstructor */
         ~Window(
         ) {
             WindowProc.disconnect(m_Connection);
         };
     private:
         friend ::LRESULT CALLBACK WndProc(::HWND, ::UINT, ::WPARAM,
::LPARAM);
         virtual ::LRESULT CALLBACK WndProc(::UINT, ::WPARAM, ::LPARAM) = 0;
     protected:
         /* Constructor */
         Window(
             ::HINSTANCE hInstance
         ) : m_Window(NULL) {
             m_Connection = WindowProc.connect(
                 boost::bind(
&Window::WndProc, this, _1, _2, _3
                 )
             );
             m_Instance = hInstance;//Might need some work...
         };
         /* Varibles */
         static ::HINSTANCE m_Instance;
                 ::HWND m_Window;
                 boost::signals::connection m_Connection;

     };

I have tried enabling WIN_API for boost and also trying to turn the pure
virtual method into a method... still no luck.

Thank you,

Etienne


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net