Sign in to follow this  

A Dialog question(please help)

This topic is 4715 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

This topic is 4715 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this