Jump to content
  • Advertisement
Sign in to follow this  
Slug

A Dialog question(please help)

This topic is 5025 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Please help me with this one, or i gonna shoot myself. I'm trying to call a dialog box with the macro DialogBox. Tell me why this sh*t of code dosen't work: this is my dialog code: /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //COptionsDlg.h #ifndef COPTIONSDLG #define COPTIONSDLG #ifdef __cplusplus #include <Windows.h> class COptionsDlg { private: public: LRESULT CALLBACK OptionsDlgProc(HWND, UINT, WPARAM, LPARAM); }; #endif #endif //COPTIONSDLG /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //COptionsDlg.cpp #include "COptionsDlg.h" LRESULT CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_INITDIALOG : // SetDlgItemInt ( hDlg, IDC_EDIT1, nEditOne, TRUE ); // SetDlgItemText( hDlg, IDC_EDIT2, szEditTwo ); break; case WM_COMMAND : switch(LOWORD(wParam)) { case IDOK : //BOOL bTran; EndDialog(hDlg, IDOK); break; case IDCANCEL : EndDialog(hDlg, IDCANCEL); break; } break; default: break; } return DefWindowProc(hDlg, uMsg, wParam, lParam); } /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// and i try to call it with: DialogBox(g_hInstance, "Options Dialog", g_hWnd, (DLGPROC)OptionDlg.OptionsDlgProc); but the damn compiler say: error C2440: 'type cast' : cannot convert from '' to 'int (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)' None of the functions with this name in scope match the target type what the problem? pleeeeeeeeease help me...

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!