CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    2

    ActiveX -- exception in DoPropExchange()

    I get the following exception being thrown when DoPropExchange()is called inside my ActiveX control. The dialog containing the control will not come up. What am I doing wrong?

    CArchive exception: endOfFile.
    Warning: CreateDlgControls failed during dialog init.
    Info: AfxDllCanUnloadNow returning S_OK
    First-chance exception in TestApp.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
    Info: AfxDllCanUnloadNow returning S_OK
    The thread 0x11D has exited with code 0 (0x0).
    The program 'R:\Source\ActiveX\TestApp\Debug\TestApp.exe' has exited with code 0 (0x0).

    Here is what the function looks like. After some experimentation (commenting out lines and changing the order of the lines) I discovered that it allways happens the second time PX_Long() or PX_Bool() is called.

    void CTimeCodeOcxCtrl:oPropExchange(CPropExchange* pPX)
    {
    ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
    COleControl:oPropExchange(pPX);

    // TODO: Call PX_ functions for each persistent custom property.

    VERIFY(PX_Long(pPX, _T("Format"), m_Format, (long)0 ));
    VERIFY(PX_Bool(pPX, _T("ClipChildren"), m_ClipChildren, FALSE ));
    VERIFY(PX_Long(pPX, _T("Border"), m_Border, (long)0 ));
    VERIFY(PX_Long(pPX, _T("Rate"), m_Rate, (long)0 ));
    VERIFY(PX_Bool(pPX, _T("ClipSiblings"), m_ClipSiblings, FALSE ));
    }



  2. #2
    Join Date
    Apr 1999
    Location
    Portland, OR, USA
    Posts
    18

    Re: ActiveX -- exception in DoPropExchange()

    I have a question for you... Why do you surround the PX_ function calls with VERIFY()? Perhaps this is causing your problems. I have an ActiveX Control project with PX_ functions, but I do not use VERIFY() and it works just fine.

    You shouldn't have to verify them anyway, because you should initialize the member variables (a.k.a. m_Format) in your constructor.

    Good luck!

    Try removing the VERIFY() from around the calls and see what happens.

    Valerie Bradley
    http://www.synthcom.com/~val
    [email protected]

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured