Board index » cppbuilder » Problem with BCB6 created ActiveX Control under CAVO26

Problem with BCB6 created ActiveX Control under CAVO26

folks,

i've create a simple ActiveX Control with Borland C++ Builder 6, which
i've tested successfully in VBA  (using a Word document).

using CAVO26 ide, i can generate code using "Tools->Setup OLE
Control->Generate Class".

"Add to Pallette" works fine, too.

when i try to place the control on a window, i got the following assertion:

ATLASSERT pClientSite == NULL || m_spClientSite == NULL
(see code below)

after that VO crashes (independent of YES, NO, CANCEL)

SetClientSite (see code below) is called from the ActiveX-Container (CAVO).

looking a little in news-archives there was suggested to comment the
line out, but this leads to a crash.

I think the error is @CAVO, as the OCX works fine with VBA, but i'm not
sure.

any suggestions?

Remark 1: note that this must not be the main reason that the control
crashes.

Remark 2: i'm really not sure where to set the followup. please decide
if your post is a subject for both groups.

form \Cbuilder6\Include\Atl\atlctl.h
//--------------------------------------------------------------------------------------------
inline HRESULT CComControlBase::IOleObject_SetClientSite(IOleClientSite
*pClientSite)
{
    ATLASSERT(pClientSite == NULL || m_spClientSite == NULL);
    m_spClientSite = pClientSite;
    m_spAmbientDispatch.Release();
    if (m_spClientSite != NULL)
    {
        m_spClientSite->QueryInterface(IID_IDispatch,
            (void**) &m_spAmbientDispatch.p);
    }
    return S_OK;

Quote
}

//--------------------------------------------------------------------------------------------

Voerror.txt

***********************ERROR********************************
CA-Visual Objects (Version 2.6.0, Build 1151), Version 2.6
22.05.2003 22:20:52
Application: C:\Programme\CAVO26\BIN\Testcont.exe

Error message:
--------------
Error Code:  50 [ ACCESS VIOLATION ]
Subsystem: VO-CODE
Error Subcode: 5333
Function:
Argument Number: 7

Error Object created:
--------------------
SubSystem       :VO-CODE
SubCode         :5333
GenCode         :Access Violation
ExceptionCode   :0EEDFADE
ExceptionFlags  :00000001
ExceptionAddress:77F1D642
ParamNumber     :7
ExceptionInfo   :051BEACC
Severity        :2
CanDefault      :.F.
CanRetry        :.F.
CanSubstitute   :.F.
Operation       :
Description     :
FileName        :
Tries           :0
FileHandle      :0
SubCodeText     :
Arg             :
ArgTypeReq      :NIL
MaxSize         :0
SubstituteType  :NIL
CallFuncSym     :
--------------------

 

Re:Problem with BCB6 created ActiveX Control under CAVO26


ok, another question:

has anyone encountered problems when using ActiveX Controls under VO?
What is the best way to debug this?
has anyone encountered problems when using an BCB6 created ActiveX
Controls under another System? What is the best way to debug this?

Quote
usenet wrote:
> folks,

> i've create a simple ActiveX Control with Borland C++ Builder 6, which
> i've tested successfully in VBA  (using a Word document).

> using CAVO26 ide, i can generate code using "Tools->Setup OLE
> Control->Generate Class".

> "Add to Pallette" works fine, too.

> when i try to place the control on a window, i got the following
> assertion:

> ATLASSERT pClientSite == NULL || m_spClientSite == NULL
> (see code below)

> after that VO crashes (independent of YES, NO, CANCEL)

> SetClientSite (see code below) is called from the ActiveX-Container
> (CAVO).

> looking a little in news-archives there was suggested to comment the
> line out, but this leads to a crash.

> I think the error is @CAVO, as the OCX works fine with VBA, but i'm
> not sure.

> any suggestions?

> Remark 1: note that this must not be the main reason that the control
> crashes.

> Remark 2: i'm really not sure where to set the followup. please decide
> if your post is a subject for both groups.

> form \Cbuilder6\Include\Atl\atlctl.h
> //--------------------------------------------------------------------------------------------

> inline HRESULT
> CComControlBase::IOleObject_SetClientSite(IOleClientSite *pClientSite)
> {
>    ATLASSERT(pClientSite == NULL || m_spClientSite == NULL);
>    m_spClientSite = pClientSite;
>    m_spAmbientDispatch.Release();
>    if (m_spClientSite != NULL)
>    {
>        m_spClientSite->QueryInterface(IID_IDispatch,
>            (void**) &m_spAmbientDispatch.p);
>    }
>    return S_OK;
> }
> //--------------------------------------------------------------------------------------------

> Voerror.txt

> ***********************ERROR********************************
> CA-Visual Objects (Version 2.6.0, Build 1151), Version 2.6
> 22.05.2003 22:20:52
> Application: C:\Programme\CAVO26\BIN\Testcont.exe

> Error message:
> --------------
> Error Code:  50 [ ACCESS VIOLATION ]
> Subsystem: VO-CODE
> Error Subcode: 5333
> Function:
> Argument Number: 7

> Error Object created:
> --------------------
> SubSystem       :VO-CODE
> SubCode         :5333
> GenCode         :Access Violation
> ExceptionCode   :0EEDFADE
> ExceptionFlags  :00000001
> ExceptionAddress:77F1D642
> ParamNumber     :7
> ExceptionInfo   :051BEACC
> Severity        :2
> CanDefault      :.F.
> CanRetry        :.F.
> CanSubstitute   :.F.
> Operation       :
> Description     :
> FileName        :
> Tries           :0
> FileHandle      :0
> SubCodeText     :
> Arg             :
> ArgTypeReq      :NIL
> MaxSize         :0
> SubstituteType  :NIL
> CallFuncSym     :
> --------------------

Other Threads