Results 1 to 2 of 2

Thread: ActiveX - passing controls??

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Location
    Denver
    Posts
    265

    ActiveX - passing controls??

    I've got a dll I've been working on that performs a couple functions based on different properties. All is well and good...but what I need to do now is somehow pass a listview (or the contents thereof) to the activex dll...(the listview is report style with small icons in the first column). Once I get that to work I've already got the code to do what is needed with the various subitems of the control, but I don't have any experience with passing controls to dll, nor do I even know if it's possible.

    I realize that I could take the text from the listview and put it into an array and pass the array, but then I won't have access to the listview's properties such as icons, smallicons etc...

    Please help me out with a bit of code & suggestions if you have any!

    Thanks,
    Acoustic

  2. #2
    Addicted Member eer3's Avatar
    Join Date
    Sep 2000
    Location
    Ca
    Posts
    165
    I'm pretty sure that you can, though I'm not sure what you would do with it from there, but it seems as though you've already got that part figured out anyhow. Use the Let and Get Properties to pass the object. Then set a reference = to the object in the Let property.

    This example uses a listbox, but I'm sure you could pass a ListView control as well.

    'Put this in your exe project
    Private Sub CommandButton1_Click()
    'You'll need a reference to your DLL here, made with createobject..
    'or however you already reference it... I'll assume that you have
    'that reference and it is called MyDLLRef
    MyDLLRef.MyObject(ListBox1) = "ListBox1 Object"
    End Sub


    'Put this in your DLL
    Public Property Get MyObject(objLSV As Object) As Variant

    End Property

    Public Property Let MyObject(ByRef objLSB As Object, ByVal vNewValue As Variant)

    Dim objNewLSB As Object
    Set objNewLSB = objLSB

    'Now all properties of the Listbox can be made with objNewLSB
    End Property

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