Thread: Confused with Variants

  1. #1
    Registered User
    Join Date
    Nov 2001

    Smile Confused with Variants

    I am trying to incorporate a VB ocx into a VC++ application I am working on. I downloaded an .ocx that someone had written in VB that is essentially a grid where each cell is a combobox. They have a member function called comboAddItem, where the argument to this function is a variant. In VB, you can pass an integer, string of whatever you want to populate the comboboxes. However, if I try to pass an int or a string in VC, I get an error message saying, "Cannot convert int (or string or whatever) to struct tag VARIANT *".
    So my question is, what type of structure am I supposed to set up for this variant so I can pass data to this function?? Or more simply, how do variants work??

  2. #2
    the Corvetter
    Join Date
    Sep 2001
    > how do variants work??

    Variants are an undefined type (can be anything).

    --Garfied the Programmer
    1978 Silver Anniversary Corvette

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New to C++ and confused by boolean and ifs and else
    By jconner in forum C++ Programming
    Replies: 10
    Last Post: 08-02-2006, 03:29 AM
  2. Confused
    By (TNT) in forum C# Programming
    Replies: 1
    Last Post: 11-23-2005, 04:49 PM
  3. why wont this compile?!? :confused:
    By jdude in forum C++ Programming
    Replies: 5
    Last Post: 11-25-2004, 01:13 AM
  4. confused.. in selecting my line of deapth
    By jawwadalam in forum A Brief History of
    Replies: 4
    Last Post: 05-04-2003, 01:21 PM
  5. Extern Question, really confused
    By SourceCode in forum C Programming
    Replies: 10
    Last Post: 03-26-2003, 11:11 PM