VC++ 6.0 and DX8.0 application compilation problem.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: VC++ 6.0 and DX8.0 application compilation problem.

  1. #1
    Join Date
    Dec 2010
    Posts
    617

    VC++ 6.0 and DX8.0 application compilation problem.

    I need to re-compile an old DX8 application. Temp I don't want to recode it.
    So I compile it in my XP VM with VC++ 6.0.

    I got this
    Code:
    C:\DXSDK\samples\Multimedia\common\src\d3dapp.cpp(1308) : error C2664: 'DialogBoxParamA' : cannot convert parameter 4 from 'long (struct HWND__ *,unsigned int,unsigned int,long)' to 'int (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'
            None of the functions with this name in scope match the target type
    How can it be fixed?
    Thank you very much
    Jack

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,419

    Re: VC++ 6.0 and DX8.0 application compilation problem.

    Could you show how you call this function and what parameters pass in it?
    Victor Nijegorodov

  3. #3
    Join Date
    Dec 2010
    Posts
    617

    Re: VC++ 6.0 and DX8.0 application compilation problem.

    Quote Originally Posted by VictorN View Post
    Could you show how you call this function and what parameters pass in it?
    Code:
    static INT_PTR CALLBACK SelectDeviceProc( HWND hDlg, UINT msg, 
                    WPARAM wParam, LPARAM lParam );
    
    typedef long INT_PTR, *PINT_PTR;
    
    
    // Prompt the user to change the mode
        if( IDOK != DialogBoxParam( (HINSTANCE)GetModuleHandle(NULL),
                                    MAKEINTRESOURCE(IDD_SELECTDEVICE), m_hWnd,
                                    SelectDeviceProc, (LPARAM)this ) )
    Last edited by lucky6969b; November 4th, 2012 at 02:47 AM.

  4. #4
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,419

    Re: VC++ 6.0 and DX8.0 application compilation problem.

    Quote Originally Posted by lucky6969b View Post
    Code:
    static INT_PTR CALLBACK SelectDeviceProc( HWND hDlg, UINT msg, 
                    WPARAM wParam, LPARAM lParam );
    
    typedef long INT_PTR, *PINT_PTR;
    
    
    // Prompt the user to change the mode
        if( IDOK != DialogBoxParam( (HINSTANCE)GetModuleHandle(NULL),
                                    MAKEINTRESOURCE(IDD_SELECTDEVICE), m_hWnd,
                                    SelectDeviceProc, (LPARAM)this ) )
    Why do you redefine INT_PTR?
    By design of Microsoft it is mapped to int on 32-bit platforms, not to long!
    You have to remove your typedef (or, at least correct it)
    Victor Nijegorodov

  5. #5
    Join Date
    Dec 2010
    Posts
    617

    Re: VC++ 6.0 and DX8.0 application compilation problem.

    Hi Victor,
    I did not redefine it. It was contained inside the application framework of DirectX 8.1 SDK.
    Thanks
    Jack

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center