Thread: Passing array of doubles to ATL COM dll

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    8

    Passing array of doubles to ATL COM dll

    Hi,
    I'm developing a DLL Atl com. I want pass as parameter one array of doubles.

    I read the best form to do it is with VARIANT* parameter in C++ and manage ir as SAFEARRAY. But It seems very complicated.

    It is the best form to do it? How do you pass array of doubles?
    Thanks

    ____________________
    HipHop Directo
    Chistes

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    You just want to pass a double array to a function? Try this prototype:
    Code:
    void take_double_array(double array[], size_t array_length);
    You can use something other than size_t if you want.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    8
    Not to a simple function. To a function in a atl dll.
    Thanks

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    SAFEARRY is probably the only way to do it. There are some articles on www.codeproject.com about it. type in "safearray" in their search engine and you will get a list of articles
    Last edited by Ancient Dragon; 04-11-2006 at 02:56 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help passing nxn array to 2d array.
    By beglaryanh in forum C Programming
    Replies: 2
    Last Post: 06-06-2009, 05:23 PM
  2. Structures, passing array of structures to function
    By saahmed in forum C Programming
    Replies: 10
    Last Post: 04-05-2006, 11:06 PM
  3. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM
  4. Help with an Array
    By omalleys in forum C Programming
    Replies: 1
    Last Post: 07-01-2002, 08:31 AM
  5. Hi, could someone help me with arrays?
    By goodn in forum C Programming
    Replies: 20
    Last Post: 10-18-2001, 09:48 AM