CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Problem...

  1. #1
    Guest

    Problem...

    Can someone help me with a problem I am having. I am trying to register the winproc function as the lpfnWndProc variable of my WNDCLASS.
    here is the function I have defined previously

    long WINAPI WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);



    and then in the WinMain function I try to say

    WNDCLASS wc;

    wc.lpfnWndProc = WinProc;




    The error I get looks like this:
    error C2440: '=' : cannot convert from 'long (__stdcall CMainGL::*)(struct HWND__ *,unsigned int,unsigned int,long)' to 'long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'

    As you can probably deduce from the error, this function calling is taking place inside a class called CMainGL.(I am trying to incorperate opengl as well). However, should it really matter if it is __stdcall CMainGL::* or __stdcall * . What is the difference and how do I get around this.


  2. #2
    Guest

    Re: Problem...

    Try making your WinProc static


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured