recien me termine de ver estos 29 tutoriales, y empeze un nuevo proyecto y antes que nada ya tengo un error.
Código
// Dialog.cpp: implementation of the Dialog class. // ////////////////////////////////////////////////////////////////////// #include "..\HEADER FILES\Dialog.h" //#include <windows.h> ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// xDialog::xDialog(){IsShowed = false;} xDialog::~xDialog(){} BOOL CALLBACK xDialog::DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){ switch (message){ case WM_INITDIALOG: break; case WM_CLOSE: //EndDialog(hDlg, 0); break; } return FALSE; } void xDialog::Show(){ extern HINSTANCE hInst; if(!xDialog::IsShowed){ MessageBox(NULL, "true","",MB_OK); }else{ //int aa = DialogBox(hInst,MAKEINTRESOURCE(IDD_DIALOG1),0,xDialog::DialogProc); DialogBox( hInst,MAKEINTRESOURCE(IDD_DIALOG1),0,xDialog::DialogProc); IsShowed =false; } }
Código
// Dialog.h: interface for the Dialog class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_DIALOG_H__06732DBB_9D27_41B9_A3A2_ECEEC8128230__INCLUDED_) #define AFX_DIALOG_H__06732DBB_9D27_41B9_A3A2_ECEEC8128230__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <windows.h> #include "Commctrl.h" // Link: Comctl32.lib #include "resource.h" class xDialog { public: xDialog(); ~xDialog(); void Show(); private: bool IsShowed; BOOL CALLBACK DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); // END OF CLASS ////////////////////// }; #endif // !defined(AFX_DIALOG_H__06732DBB_9D27_41B9_A3A2_ECEEC8128230__INCLUDED_)
Código
//Main.cpp #include <windows.h> #include "Commctrl.h" // Link: Comctl32.lib #include "..\HEADER FILES\Dialog.h" HINSTANCE hInst; int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow){ hInst = hInstance; return 0; }
ERROR: Dialog.cpp(33) : error C2664: 'DialogBoxParamA' : cannot convert parameter 4 from 'int (struct HWND__ *,unsigned int,unsigned int,long)' to 'int (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,l
ong)'
None of the functions with this name in scope match the target type.
estoy utilizando VS C++6.0
¿Como puedo arreglar esto, ya no se por donde mirar?