Results 1 to 2 of 2

Thread: Crash at runtime with SECDialogBars

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    1

    Crash at runtime with SECDialogBars

    Hello,

    We started to upgrade our application to Visual 2012 and Stingray Studio 11.1 and , after porting the code, I couldn't execute the application at all. So I tried the sample project viz11 provided.

    I get exactly the same kind of error :

    At line 213 of mainframe.cpp, the create() call crashes the same way it does with our application when using SECDialogbar derivated classes, whatever the platform is (x64, x32, debug, unicode...) at the same final win32 call (CreateWindowEx in Winuser.inl). This is from a call to CControlBar::Create() into the sbarcode.cpp source, line 333. The crash seems to be caused by the lpszWindowName that is set to a MAKEINTRESOURCE() kind of value instead of a string. This pointer has the 0x82 value of IDD_LOGO ID and the final crash is an access violation of this value used as a string.

    I'm stuck here without any way to find a solution.
    Visual studio 2012 is the update 3 version.

    J.

  2. #2
    Junior Member
    Join Date
    Mar 2008
    Posts
    16
    I would recommend doing this in a handler for the WM_INITDIALOG message.
    The SECDialogBar base class has an implementation called HandleInitDialog().
    Here's a quick sample of how to put together the correct declarations for the message map.
    It's a good place to subclass controls and call UpdateData(), if you're doing any DDX.


    // in the header file for say, CMyDialogBar
    protected:
    afx_msg LRESULT HandleInitDialog(WPARAM, LPARAM);


    //in the implementation file, say CMyDialogBar.cpp

    BEGIN_MESSAGE_MAP(CMyDialogBar, SECDialogBar)
    //{{AFX_MSG_MAP(CMyDialogBar)
    ON_MESSAGE(WM_INITDIALOG, HandleInitDialog)
    //}}AFX_MSG_MAP
    END_MESSAGE_MAP()

    LRESULT CMyDialogBar::HandleInitDialog(WPARAM wParam, LPARAM lParam)
    {
    LRESULT lRes = SECDialogBar::HandleInitDialog(wParam, lParam);
    UpdateData(FALSE);
    return lRes;
    }

Posting Permissions

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