Activex Control arrays in Clarion 
Author Message
 Activex Control arrays in Clarion

VB allows you to declare controls with the same name and using an index
(called a control array). I need to be able to declare ActiveX controls in
Clarion using the same name with an index.

This allows you to use one set of events,methods and properties and just
refer to them by control index.

Is this possible in Clarion?

Thanks.



Tue, 15 Nov 2005 04:08:49 GMT  
 Activex Control arrays in Clarion
yes, just add as many ole controls as you want. create an array or queue of
the field equate labels. if your using interfaces directly, just make an
array of the interface addesses and cast the address to an interface before
calling.
Jim Kane


Quote:
> VB allows you to declare controls with the same name and using an index
> (called a control array). I need to be able to declare ActiveX controls in
> Clarion using the same name with an index.

> This allows you to use one set of events,methods and properties and just
> refer to them by control index.

> Is this possible in Clarion?

> Thanks.



Tue, 15 Nov 2005 05:41:29 GMT  
 Activex Control arrays in Clarion
Good to know it's possible. However, I don't really get how to do this from
your description.
I currently populate the control on a form using the standard clarion
interface. It's an ActiveX. I do have to leave the actual name of the
control blank and create it in code because of Clarion late binding issue.
But I don't have a clue of how to actually use a queue or array with the
controls. Especially so I end up with only 1 event call for all the
controls. In VB, they just use an index with the control. Do you know of any
examples of this being done with Clarion?

Thanks.
Lew Lepley


Quote:
> yes, just add as many ole controls as you want. create an array or queue
of
> the field equate labels. if your using interfaces directly, just make an
> array of the interface addesses and cast the address to an interface
before
> calling.
> Jim Kane



> > VB allows you to declare controls with the same name and using an index
> > (called a control array). I need to be able to declare ActiveX controls
in
> > Clarion using the same name with an index.

> > This allows you to use one set of events,methods and properties and just
> > refer to them by control index.

> > Is this possible in Clarion?

> > Thanks.



Tue, 15 Nov 2005 23:37:54 GMT  
 Activex Control arrays in Clarion
Forget about the window formater - it's useless for this
look at create() in the language reference manual to learn how to create an
ole control at run time. It returns a field equate label which is a long.
store the long in a queue.
there is plenty of info on queues in the lrm.
to put your object into the clarion ole control, look at prop:create.
here is a quick example from a class I wrote to display anynumber of pdfs on
a window:
Jim Kane

Acrobatcl.ShowDoc procedure(string pDocName) !,byte
cobj cstring(20)
   code
   !create a clarion ole control
    SELF.OLEControlQ.FEQ = Create(0,Create:OLE)
    If ~SELF.OLEControlQ.FEQ then SELF.ERrorstr='Cant create ole
control.';res=level:Fatal do procret.

    !create the ole object in the control
    SELF.OLEControlQ.FEQ{prop:Create}='AcroExch.AVDoc'
    cObj=SELF.OLEControlQ.Feq{prop:object}
    if cobj[1]<>'`' then
      SELF.Errorstr='Failed to create an acrobat reader object'
      res=level:fatal
      do procret
    end

   !open the document
    SELF.OLEControlQ.FEQ{'OPEN("' & Clip(pDocName) &'","")'}

    !save the control
    Add(SELF.OLEControlQ)
      if errorcode() then
         SELF.Errorstr='Out of memory'
         res=level:fatal
         do procret
      end

      !done
      Res=level:Benign
      do procret
procret routine
    return res


Quote:
> Good to know it's possible. However, I don't really get how to do this
from
> your description.
> I currently populate the control on a form using the standard clarion
> interface. It's an ActiveX. I do have to leave the actual name of the
> control blank and create it in code because of Clarion late binding issue.
> But I don't have a clue of how to actually use a queue or array with the
> controls. Especially so I end up with only 1 event call for all the
> controls. In VB, they just use an index with the control. Do you know of
any
> examples of this being done with Clarion?

> Thanks.
> Lew Lepley



> > yes, just add as many ole controls as you want. create an array or queue
> of
> > the field equate labels. if your using interfaces directly, just make an
> > array of the interface addesses and cast the address to an interface
> before
> > calling.
> > Jim Kane



> > > VB allows you to declare controls with the same name and using an
index
> > > (called a control array). I need to be able to declare ActiveX
controls
> in
> > > Clarion using the same name with an index.

> > > This allows you to use one set of events,methods and properties and
just
> > > refer to them by control index.

> > > Is this possible in Clarion?

> > > Thanks.



Wed, 16 Nov 2005 07:23:42 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ActiveX controls in Clarion and License Files

2. ActiveX controls(!) and Clarion 4

3. pass array to ActiveX Control

4. CFW 2.0 and Microsoft Internet Control Pack Beta 2 ActiveX Controls

5. Delete a control from a control array

6. Control arrays in custom controls

7. Can a control reference its control array?

8. Accessing a control from control array

9. control arrays and menu arrays

10. Converting Clarion 4 to Clarion 5 - List Box Arrays

11. APL and Excel ActiveX control

12. Checking focus of an ActiveX control's view

 

 
Powered by phpBB® Forum Software