Returning user defined types from DLL

Discussion in 'C++' started by Shlomy Shivek, Oct 19, 2006.

  1. Hi,
    I have an application that uses my DLL.

    I want the DLL to return a list type object to the application that
    calls it:
    list<Type> Proc() {
    list<Type> x;
    return x;
    }

    It pass the compliation stage but on runtime it gives me heap error.
    Is it possible to do so ?
     
    Shlomy Shivek, Oct 19, 2006
    #1
    1. Advertising

  2. * Shlomy Shivek:
    > Hi,
    > I have an application that uses my DLL.
    >
    > I want the DLL to return a list type object to the application that
    > calls it:
    > list<Type> Proc() {
    > list<Type> x;
    > return x;
    > }
    >
    > It pass the compliation stage but on runtime it gives me heap error.
    > Is it possible to do so ?


    Dynamic libraries are outside the scope of the language definition, and
    thus partially off-topic in this group.

    The short answer is, however, that you must ensure that memory allocated
    by some allocator A is also deallocated by that very same allocator A.

    How to accomplish that for DLLs is unfortunately off-topic in this group
    (ask in a Windows programming group).

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Oct 19, 2006
    #2
    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. Guilherme Pinto
    Replies:
    1
    Views:
    317
    Victor Bazarov
    Oct 10, 2003
  2. Oodini
    Replies:
    1
    Views:
    1,795
    Keith Thompson
    Sep 27, 2005
  3. Replies:
    1
    Views:
    517
    Sion Arrowsmith
    Jul 10, 2008
  4. Rafael Corchuelo

    Returning user-defined objects from a web method

    Rafael Corchuelo, Mar 6, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    129
    Rafael Corchuelo
    Mar 6, 2004
  5. Marc Walgren
    Replies:
    3
    Views:
    171
    Marc Walgren
    Aug 23, 2004
Loading...

Share This Page