Q: How can I pass UDTs into optional parameters in VB 6.0 ?

Discussion in 'MCSD' started by Ramesh, Oct 21, 2003.

  1. Ramesh

    Ramesh Guest

    I know VB does not allow passing UDTs as optional
    parameters. One of my friends is looking for a workaround,
    if possible. I will appreciate if anyone provides the
    solution.
    Ramesh, Oct 21, 2003
    #1
    1. Advertising

  2. Ramesh

    Kline Sphere Guest

    >I know VB does not allow passing UDTs as optional
    >parameters. One of my friends is looking for a workaround,
    >if possible. I will appreciate if anyone provides the
    >solution.
    >


    If the udt is declared as part of a com class, it can be passed to
    routines, although the parameter type in the routine signature must be
    declared as a variant.

    If not you have two options.

    1 - Pass in a pointer to the udt and use the copymemory, movememory
    etc api's to manipulate the udt - another reason why vb is crap.

    2 - Simple use a class instead of a udt - easy.
    Kline Sphere, Oct 21, 2003
    #2
    1. Advertising

  3. Ramesh

    Jaime Guest

    Re: How can I pass UDTs into optional parameters in VB 6.0 ?

    omg a real question, thank you.
    "Ramesh" <> wrote in message
    news:02be01c397f4$df2dc900$...
    > I know VB does not allow passing UDTs as optional
    > parameters. One of my friends is looking for a workaround,
    > if possible. I will appreciate if anyone provides the
    > solution.
    >
    >
    Jaime, Oct 22, 2003
    #3
  4. Ramesh

    Kline Sphere Guest

    Re: How can I pass UDTs into optional parameters in VB 6.0 ?

    >omg a real question, thank you.

    Although somewhat off topic, but still......
    Kline Sphere, Oct 22, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon

    Optional Accessories

    Jon, Nov 10, 2003, in forum: Digital Photography
    Replies:
    8
    Views:
    403
  2. Opticreep

    Optional censorship in DVDs...

    Opticreep, Apr 12, 2004, in forum: DVD Video
    Replies:
    20
    Views:
    1,002
    Boris
    Apr 23, 2004
  3. Allan
    Replies:
    0
    Views:
    541
    Allan
    Apr 10, 2006
  4. Rick

    Canon G5 optional lens

    Rick, Jan 7, 2005, in forum: Digital Photography
    Replies:
    2
    Views:
    296
  5. staticy2003
    Replies:
    0
    Views:
    875
    staticy2003
    Feb 24, 2008
Loading...

Share This Page