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. Advertisements

  2. Ramesh

    Kline Sphere Guest

    I know VB does not allow passing UDTs as optional
    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. Advertisements

  3. Ramesh

    Jaime Guest

    omg a real question, thank you.
     
    Jaime, Oct 22, 2003
    #3
  4. Ramesh

    Kline Sphere Guest

    omg a real question, thank you.

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.