accessing Application Prop. within an activex dll


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: accessing Application Prop. within an activex dll

  1. #1
    Gaby N. HADDAD Guest

    accessing Application Prop. within an activex dll


    Hi,
    Usually in VB we can use the forms collection to iterate into all the forms
    of an Application and then for each form we can use the control collection
    to iterate into the controls inside a specific form.
    something similar to this:

    For i= 0 To (Forms.Count - 1)
    Set frmForm = Forms(niCounter)
    For Each ctl In frmForm.Controls
    ctlScan.Caption = ...
    ...
    Next
    Next

    Is there any way to write such procedure inside an ActiveX DLL
    that access these application properties (forms collection, control collection
    ...) by passing a variable or pointer to the application ?

    (because if we check Forms.Count inside a DLL we find it empty and if we
    pass it as parameter then we have the value inside the DLL but we can't iterate
    the forms collection :
    Set frmForm = Forms(niCounter)
    ... etc
    see above)

    Any help would be appreciated.

    Thanks,
    Gaby.

  2. #2
    Mike Guest

    Re: accessing Application Prop. within an activex dll


    Gaby,

    I have seen this question posted here before. I don't think that anyone came
    up with a good solution. One possibility would be to pass the collection
    into the dll. You will have to pass it in as an object and check that it
    is a collection, then assign it to a variable dimmed as a collection in your
    dll.

    Mike


    "Gaby N. HADDAD" <gaby@alpha.com.lb> wrote:
    >
    > Hi,
    >Usually in VB we can use the forms collection to iterate into all the forms
    >of an Application and then for each form we can use the control collection
    >to iterate into the controls inside a specific form.
    >something similar to this:
    >
    > For i= 0 To (Forms.Count - 1)
    > Set frmForm = Forms(niCounter)
    > For Each ctl In frmForm.Controls
    > ctlScan.Caption = ...
    > ...
    > Next
    > Next
    >
    >Is there any way to write such procedure inside an ActiveX DLL
    >that access these application properties (forms collection, control collection
    >...) by passing a variable or pointer to the application ?
    >
    >(because if we check Forms.Count inside a DLL we find it empty and if we
    >pass it as parameter then we have the value inside the DLL but we can't

    iterate
    >the forms collection :
    > Set frmForm = Forms(niCounter)
    > ... etc
    >see above)
    >
    >Any help would be appreciated.
    >
    >Thanks,
    >Gaby.



  3. #3
    Gaby N. HADDAD Guest

    Re: accessing Application Prop. within an activex dll


    Mike,
    Thanks for the tip. but we have Forms collection and for each form we have
    a control collection.
    I have to loop into these collection and pass them as an array of collection
    .... ?


    Gaby.



    "Mike" <m_culley@one.net.au> wrote:
    >
    >Gaby,
    >
    >I have seen this question posted here before. I don't think that anyone

    came
    >up with a good solution. One possibility would be to pass the collection
    >into the dll. You will have to pass it in as an object and check that it
    >is a collection, then assign it to a variable dimmed as a collection in

    your
    >dll.
    >
    >Mike
    >
    >
    >"Gaby N. HADDAD" <gaby@alpha.com.lb> wrote:
    >>
    >> Hi,
    >>Usually in VB we can use the forms collection to iterate into all the forms
    >>of an Application and then for each form we can use the control collection
    >>to iterate into the controls inside a specific form.
    >>something similar to this:
    >>
    >> For i= 0 To (Forms.Count - 1)
    >> Set frmForm = Forms(niCounter)
    >> For Each ctl In frmForm.Controls
    >> ctlScan.Caption = ...
    >> ...
    >> Next
    >> Next
    >>
    >>Is there any way to write such procedure inside an ActiveX DLL
    >>that access these application properties (forms collection, control collection
    >>...) by passing a variable or pointer to the application ?
    >>
    >>(because if we check Forms.Count inside a DLL we find it empty and if we
    >>pass it as parameter then we have the value inside the DLL but we can't

    >iterate
    >>the forms collection :
    >> Set frmForm = Forms(niCounter)
    >> ... etc
    >>see above)
    >>
    >>Any help would be appreciated.
    >>
    >>Thanks,
    >>Gaby.

    >



  4. #4
    Mike Guest

    Re: accessing Application Prop. within an activex dll


    Gaby,

    Once you pass it into your dll you can use it as you normally would.

    Mike


    "Gaby N. HADDAD" <gaby@alpha.com.lb> wrote:
    >
    > Mike,
    >Thanks for the tip. but we have Forms collection and for each form we have
    >a control collection.
    >I have to loop into these collection and pass them as an array of collection
    >.... ?
    >
    >
    >Gaby.
    >
    >
    >
    >"Mike" <m_culley@one.net.au> wrote:
    >>
    >>Gaby,
    >>
    >>I have seen this question posted here before. I don't think that anyone

    >came
    >>up with a good solution. One possibility would be to pass the collection
    >>into the dll. You will have to pass it in as an object and check that it
    >>is a collection, then assign it to a variable dimmed as a collection in

    >your
    >>dll.
    >>
    >>Mike
    >>
    >>
    >>"Gaby N. HADDAD" <gaby@alpha.com.lb> wrote:
    >>>
    >>> Hi,
    >>>Usually in VB we can use the forms collection to iterate into all the

    forms
    >>>of an Application and then for each form we can use the control collection
    >>>to iterate into the controls inside a specific form.
    >>>something similar to this:
    >>>
    >>> For i= 0 To (Forms.Count - 1)
    >>> Set frmForm = Forms(niCounter)
    >>> For Each ctl In frmForm.Controls
    >>> ctlScan.Caption = ...
    >>> ...
    >>> Next
    >>> Next
    >>>
    >>>Is there any way to write such procedure inside an ActiveX DLL
    >>>that access these application properties (forms collection, control collection
    >>>...) by passing a variable or pointer to the application ?
    >>>
    >>>(because if we check Forms.Count inside a DLL we find it empty and if

    we
    >>>pass it as parameter then we have the value inside the DLL but we can't

    >>iterate
    >>>the forms collection :
    >>> Set frmForm = Forms(niCounter)
    >>> ... etc
    >>>see above)
    >>>
    >>>Any help would be appreciated.
    >>>
    >>>Thanks,
    >>>Gaby.

    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center