ActiveX. Two questions. - Programmer

This is a discussion on ActiveX. Two questions. - Programmer ; Hello, With the aid of ATL I created a COM component (dll). Let's say its name is "Arka". It works pretty well and everything seems to be OK. Now I want to wrap it and add visual side in order ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: ActiveX. Two questions.

  1. ActiveX. Two questions.

    Hello,

    With the aid of ATL I created a COM component (dll). Let's say its name is
    "Arka". It works pretty well and everything seems to be OK. Now I want to
    wrap it and add visual side in order to put it on a Web; in other words
    change it into a new control. Probably an ActiveX. And here two problems
    emerge.

    1. How can I use all the functionality included in Arka in the new
    component. I've heard a bit abt. agregation, but do not know how to start.
    Assume name of the control will be "ArkaX". Do I need to files to make it
    run. I mean Arka.dll and ArkaX.ocx? Where can I find a few samples concernig
    this problem: using one interface by other object?

    2. I intend to put ArkaX on my Web. I will need HTML code with OBJECT and
    CODEBASE. The later word specifies where the CAB file is to be located. The
    question is if I can prepare the CAB file which can be instaled by a user on
    its local machine without applying for a certificate. Described in MSDN
    proces seems to be very complex. Is it so complex indeed?

    --
    Best regards,
    Tumor Mozgowicz
    "Of all the things I've lost, I miss my mind the most!" - Ozzy Osbourne.
    CAUTION: To reply directly reverse my first name in the e-mail address.


  2. Re: ActiveX. Two questions.


    "Tumor Mozgowicz" wrote in message
    news:bp0ca6$omg$1@inews.gazeta.pl...
    > Hello,
    >
    > With the aid of ATL I created a COM component (dll). Let's say its name is
    > "Arka". It works pretty well and everything seems to be OK. Now I want to
    > wrap it and add visual side in order to put it on a Web; in other words
    > change it into a new control. Probably an ActiveX. And here two problems
    > emerge.
    >
    > 1. How can I use all the functionality included in Arka in the new
    > component. I've heard a bit abt. agregation, but do not know how to start.
    > Assume name of the control will be "ArkaX". Do I need to files to make it
    > run. I mean Arka.dll and ArkaX.ocx? Where can I find a few samples

    concernig
    > this problem: using one interface by other object?

    When creating COM component in ATL Wizard, you can specify if it supports
    aggregation (via a checkbox). As far as code is concerned, the following
    line adds aggr. support:

    class ATL_NO_VTABLE CAggObj :
    ....
    public CComCoClass // THIS is the line!
    ....

    That's because class CComCoClass implement aggr.

    The above stuff takes care of inner object.

    In outer object you could do the following:

    class COuter : public IOuter,
    ....
    {
    HRESULT FinalConstruct()
    {
    return CoCreateInstance(CLSID_CAggObj,
    GetControllingUnknown(),
    CLSCTX_INPROC_SERVER,
    IID_IUnknown,
    (void**)&m_pUnkInner);
    }

    FinalRelease()
    {
    m_pUnkInner->Release();
    }
    DECLARE_PROTECT_FINAL_CONSTRUCT()
    DECLARE_GET_CONTROLLING_UNKNOWN()
    CComPtr m_pUnkInner;

    BEGIN_COM_MAP(COuter)
    COM_INTERFACE_ENTRY(IOuter)
    COM_INTERFACE_ENTRY_AGGREGATE(IID_IAgg,m_pUnkInner )
    END_COM_MAP
    }




    >
    > 2. I intend to put ArkaX on my Web. I will need HTML code with OBJECT and
    > CODEBASE. The later word specifies where the CAB file is to be located.

    The
    > question is if I can prepare the CAB file which can be instaled by a user

    on
    > its local machine without applying for a certificate. Described in MSDN
    > proces seems to be very complex. Is it so complex indeed?

    I'm not sure about this one. However, if your control doesn't have a valid
    certificate it will be rejected by IE, unless web site is in Trusted or
    Intranet zones.

    >
    > --
    > Best regards,
    > Tumor Mozgowicz
    > "Of all the things I've lost, I miss my mind the most!" - Ozzy Osbourne.
    > CAUTION: To reply directly reverse my first name in the e-mail address.
    >




  3. Re: ActiveX. Two questions.

    Oops,

    I believe it's:

    FinalRelease()
    {
    m_pUnkInner.Release();
    }

    rather than:

    FinalRelease()
    {
    m_pUnkInner->Release();
    }

    as I wrote in my previous post. You could even skip this code because being
    smart pointer 'm_pUnkInner' destructor will call 'Release()' for when
    CAggObj is destroyed.

    Sorry for mistake,
    Boris

    "Boris Dynin" wrote in message
    news:zh1tb.6393$Wy2.89520@typhoon.sonic.net...
    >
    > "Tumor Mozgowicz" wrote in message
    > news:bp0ca6$omg$1@inews.gazeta.pl...
    > > Hello,
    > >
    > > With the aid of ATL I created a COM component (dll). Let's say its name

    is
    > > "Arka". It works pretty well and everything seems to be OK. Now I want

    to
    > > wrap it and add visual side in order to put it on a Web; in other words
    > > change it into a new control. Probably an ActiveX. And here two problems
    > > emerge.
    > >
    > > 1. How can I use all the functionality included in Arka in the new
    > > component. I've heard a bit abt. agregation, but do not know how to

    start.
    > > Assume name of the control will be "ArkaX". Do I need to files to make

    it
    > > run. I mean Arka.dll and ArkaX.ocx? Where can I find a few samples

    > concernig
    > > this problem: using one interface by other object?

    > When creating COM component in ATL Wizard, you can specify if it supports
    > aggregation (via a checkbox). As far as code is concerned, the following
    > line adds aggr. support:
    >
    > class ATL_NO_VTABLE CAggObj :
    > ...
    > public CComCoClass // THIS is the line!
    > ...
    >
    > That's because class CComCoClass implement aggr.
    >
    > The above stuff takes care of inner object.
    >
    > In outer object you could do the following:
    >
    > class COuter : public IOuter,
    > ...
    > {
    > HRESULT FinalConstruct()
    > {
    > return CoCreateInstance(CLSID_CAggObj,
    > GetControllingUnknown(),
    > CLSCTX_INPROC_SERVER,
    > IID_IUnknown,
    > (void**)&m_pUnkInner);
    > }
    >
    > FinalRelease()
    > {
    > m_pUnkInner->Release();
    > }
    > DECLARE_PROTECT_FINAL_CONSTRUCT()
    > DECLARE_GET_CONTROLLING_UNKNOWN()
    > CComPtr m_pUnkInner;
    >
    > BEGIN_COM_MAP(COuter)
    > COM_INTERFACE_ENTRY(IOuter)
    > COM_INTERFACE_ENTRY_AGGREGATE(IID_IAgg,m_pUnkInner )
    > END_COM_MAP
    > }
    >
    >
    >
    >
    > >
    > > 2. I intend to put ArkaX on my Web. I will need HTML code with OBJECT

    and
    > > CODEBASE. The later word specifies where the CAB file is to be located.

    > The
    > > question is if I can prepare the CAB file which can be instaled by a

    user
    > on
    > > its local machine without applying for a certificate. Described in MSDN
    > > proces seems to be very complex. Is it so complex indeed?

    > I'm not sure about this one. However, if your control doesn't have a valid
    > certificate it will be rejected by IE, unless web site is in Trusted or
    > Intranet zones.
    >
    > >
    > > --
    > > Best regards,
    > > Tumor Mozgowicz
    > > "Of all the things I've lost, I miss my mind the most!" - Ozzy Osbourne.
    > > CAUTION: To reply directly reverse my first name in the e-mail address.
    > >

    >
    >




  4. Re: ActiveX. Two questions.

    Hi,

    Those text below looks rather complex for me not to say it's a pice of
    "black magic" :-), but thx for showing me the proper direction. I think now
    with the help of God and MSDN I will find out what it's all about.

    many thx and...
    --
    Best regards,
    Tumor Mozgowicz
    "Of all the things I've lost, I miss my mind the most!" - Ozzy Osbourne.
    CAUTION: To reply directly reverse my first name in the e-mail address.


    | When creating COM component in ATL Wizard, you can specify if it supports
    | aggregation (via a checkbox). As far as code is concerned, the following
    | line adds aggr. support:
    |
    | class ATL_NO_VTABLE CAggObj :
    | ...
    | public CComCoClass // THIS is the line!
    | ...
    |
    | That's because class CComCoClass implement aggr.
    |
    | The above stuff takes care of inner object.
    |
    | In outer object you could do the following:
    |
    | class COuter : public IOuter,
    | ...
    | {
    | HRESULT FinalConstruct()
    | {
    | return CoCreateInstance(CLSID_CAggObj,
    | GetControllingUnknown(),
    | CLSCTX_INPROC_SERVER,
    | IID_IUnknown,
    | (void**)&m_pUnkInner);
    | }
    |
    | FinalRelease()
    | {
    | m_pUnkInner->Release();
    | }
    | DECLARE_PROTECT_FINAL_CONSTRUCT()
    | DECLARE_GET_CONTROLLING_UNKNOWN()
    | CComPtr m_pUnkInner;
    |
    | BEGIN_COM_MAP(COuter)
    | COM_INTERFACE_ENTRY(IOuter)
    | COM_INTERFACE_ENTRY_AGGREGATE(IID_IAgg,m_pUnkInner )
    | END_COM_MAP
    | }
    |






+ Reply to Thread