我用vc6.0编译的时候老是出一个错误。error C2664: 'CreateDialogParamA' : cannot convert parameter 4 from 'long (struct HWND__ *,unsigned int,unsigned int,long)' to 'int (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'出错的代码是  LRESULT CALLBACK DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
     g_hDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);CreateDialog();可能是因为这个函数最后一个参数的类型是DLGPROC,跟LRESULT不是一样,但是我还有一个程序也是这样的怎么就能通过,我看了一下两个程序的区别,另一个程序比这个程序多一个文件夹External Dependencies,里面有一个basets.h和resourse.hm,我猜可能是这里的原因,我上网查说这个文件夹External Dependencies是编译时自动生成的,但是我的怎么就无法生成呢,我换了一个绿色免安装的VC6.0也不行。而且两个VC都无法file->open,这是哪里出了问题啊 还望高手指点,是软件问题还是文件配置问题,还是其他什么问题 

解决方案 »

  1.   

    调用的问题了,'CreateDialogParamA' 的第四个参数是int 类型,你调用的时候给了long类型,与其他问题没关系了
      

  2.   

    我强制装换后没发生成对话框,用WIN32编程生成对话框的顺序是什么啊,我是creatdialog(),然后setwindowpos(),这样就可以了吗?本人刚接触VC,很多不懂
      

  3.   

    DialogProc Function--------------------------------------------------------------------------------CALLBACK 这个宏在什么和定义中都有没有?
    The DialogProc function is an application-defined callback function used with the CreateDialog and DialogBox families of functions. It processes messages sent to a modal or modeless dialog box. The DLGPROC type defines a pointer to this callback function. DialogProc is a placeholder for the application-defined function name. SyntaxINT_PTR CALLBACK DialogProc(          HWND hwndDlg,
        UINT uMsg,
        WPARAM wParam,
        LPARAM lParam
    );
    ParametershwndDlg
    [in] Handle to the dialog box. 
    uMsg
    [in] Specifies the message. 
    wParam
    [in] Specifies additional message-specific information. 
    lParam
    [in] Specifies additional message-specific information. 
      

  4.   

    g_hDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, (LPARAM )DlgProc); 
      

  5.   

    对,就是调用的时候,参数类型不对。
    最好看下MSDN
      

  6.   

    CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1),NULL,(DLGPROC)DlgProc);