title: Pass object's pointer as parameter to DialogBoxParam()
body: <p>I would like to pass an object's pointer as the fifth parameter of <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms645465%28v=vs.85%29.aspx" rel="nofollow"><code>DialogBoxParam()</code></a>.  </p>
  
  <pre><code>INT_PTR WINAPI DialogBoxParam(
    _In_opt_  HINSTANCE hInstance,
    _In_      LPCTSTR lpTemplateName,
    _In_opt_  HWND hWndParent,
    _In_opt_  DLGPROC lpDialogFunc,
    _In_      LPARAM dwInitParam
  );</code></pre>
  
  <p><br>
  Here is my call to <code>DialogBoxParam()</code> :</p>
  
  <pre><code>MyClass *myObject = new MyClass();
  DialogBoxParam(
      GetModuleHandle(NULL),
      MAKEINTRESOURCE(IDD_SELECT_ETC),
      hwnd,
      CallbackDlgProc,
      (LPARAM)&myObject
  );
  </code></pre>
  
  <p>And here is one of my tries in <code>CallbackDlgProc()</code> (knowing myFile is a public char* member of <code>myObject</code>) :</p>
  
  <pre><code>BOOL CALLBACK CallbackDlgProc(HWND hwndDlg, UINT Message, WPARAM wParam, LPARAM lParam)
  {
      switch(Message)
      {
          case WM_INITDIALOG:
          {
              MessageBox(NULL, (CHAR*)((*(MyClass*)lParam).myFile), "Title", MB_OK);
              return TRUE;
          }
          case [...]
      }
  }
  </code></pre>
  
  <p><br>
  Any idea how I could access and edit <code>myObject</code> from <code>CallbackDlgProc()</code> ?</p>