Dynamic Object Creation... Possible?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Dynamic Object Creation... Possible?

  1. #1
    Jordan Guest

    Dynamic Object Creation... Possible?


    I'm trying to determine if it is possible to dynamically set an object. In
    other words, if I have a variable name (say MyCalx), is it possible to pass
    that to a subroutine and do a Set MyCalx as New Calendar. It seems to work
    when I do this, but cannot access any of the properties or functions using
    MyCalx. If I try something like MyCalx.getdate() it comes back with "object
    required".

    Any help on this would be greatly appreciated.

    Jordy

  2. #2
    Russell Jones Guest

    Re: Dynamic Object Creation... Possible?

    Use Set MyCalx = Server.CreateObject("<ProgID>") instead of
    Set MyCalx as New Calendar. You need the ProgID for the Calendar object.


    "Jordan" <jordys@mediaone.net> wrote in message
    news:3bc364fe$1@news.devx.com...
    >
    > I'm trying to determine if it is possible to dynamically set an object.

    In
    > other words, if I have a variable name (say MyCalx), is it possible to

    pass
    > that to a subroutine and do a Set MyCalx as New Calendar. It seems to

    work
    > when I do this, but cannot access any of the properties or functions using
    > MyCalx. If I try something like MyCalx.getdate() it comes back with

    "object
    > required".
    >
    > Any help on this would be greatly appreciated.
    >
    > Jordy




  3. #3
    venki Guest

    Re: Dynamic Object Creation... Possible?


    dear friend,

    try passing the mycalx object to an object variable in the called function.
    ie create an object within the called routine and then pass the mycalx object


    regards
    venki

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