Results 1 to 3 of 3

Thread: Newbee to ActiveX DLL

  1. #1

    Thread Starter
    Hyperactive Member mvrp350's Avatar
    Join Date
    Feb 2001
    Location
    Best, the Netherlands
    Posts
    322

    Question Newbee to ActiveX DLL

    Hi there,

    I'm a newbee to activeX Dll programming, so this is probably an easy question for you guys.

    I want to create a Dll that calculates the pieces of wood in a stocked piece.

    So my input will be:
    type Wood => sectionX, sectionY, Length, Number, Name
    type InStock => sectionX, sectionY, Length, Number

    and my output will be:
    type Combined => sectionX, sectionY, Length, list of wood.name

    My question is:
    How can I declare the types Wood and Instock so that I can use it to store information, and make calculations with it. Also how can I make the type Combined so it can be read from my other applications.

    I have read something about the property Get and Let, but that doesn't read/write my types.

    Thanx in advance

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    you have to use Let n Get to make what you want
    here is what you do

    STEPS
    ----------

    1. New Activex DLL project (comes with a class module)
    2. Right click the activex dll project in the project explorer, give it a name, description
    3. in your regular project, go to project>references>find your activex dll, select it
    4. in your class module (activex dll)
    type

    Option Explicit
    dim m_woodName as string

    Public Property Let SetWoodName(woodName as string)
    m_woodName = woodName
    End Property

    Public Property Get GetWoodName() as string
    WoodName = m_woodName
    End Property

    5. in your regular project
    type (in a form)

    Option Explicit
    dim objWood as myObj.clsWood

    Form Load event, type

    objWood.SetWoodName("oak")

    msgbox objWood.GetWoodName

    (didn't test so there might be mistakes)

    set objWood = new myObj.clsWood
    (now your ready to use it)

    objWood.

  3. #3

    Thread Starter
    Hyperactive Member mvrp350's Avatar
    Join Date
    Feb 2001
    Location
    Best, the Netherlands
    Posts
    322
    Thanks Kovan,

    your code really helped me out, but the thing I am trying to accomplish is to create a type so I can add all the information in that type.
    So in the case of your example:
    I want to create a type Wood.
    The properties are name and length.

    type wood
    name as string
    length as long
    end type


    If I want to add information my call is something like:

    Wood.name = "oak"
    Wood.length = 2761

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