Passing pointer to an object containing vector to a dll function
===

I had an idea to create a report printing dialog that could be configurable, e.g. i made a listbox on it, read available reports that are registered in a database. Then, an user could just click on one item in the listbox, click print (let's omit any report parameters for the sake of this question). Adding any new report could be as simple as registering a new dll in the database. All report dlls shoud have a commonly named PrintReport function. 

Also, printing should be easy for a programmer writing these dlls. He is given a pointer to an object that he could use for gdiplus drawing.

Here's what i did:

- created said dialog
- created a namespace (PRINTOUT) and some classes in it (one of them is Print, which contains fully initialized Gdiplus::Graphics object and a vector of pointers to metafiles used for print preview)
- created this universal function in the dll which is declared as:

        extern "C" __declspec(dllexport) int PrintReport(PRINTOUT::Print *prn, LONG_PTR ReportData);

- i then created an object and called the dll library in the following way:

        //a pointer because i will delete it before unloading a dll. Dll loading code omitted.
        typedef BOOL (*tFUNC)(PRINTOUT::Print *, LONG_PTR);
        tFUNC fFUNC=reinterpret_cast<tFUNC>(GetProcAddress(LibInst, "PrintReport"));
        PRINTOUT::Print *prn=new PRINTOUT::Print();
        //this should print using gdiplus object pointer contained in the prn
        //after printing this function just exits
        fFUNC(prn, RpData);
        //cleanup within destructor
        delete prn;
        FreeLibrary(LibInst);

**THE problem:** Function in a dll has completely different addresses of vectors contained within the *prn* object and i don't understand why. Actually earlier i tried to just declare PRINTOUT::Print prn and pass by reference fFUNC(&prn, RpData) but there was little or no difference. Please try to explain to me why this happens. Address of the *prn* object is the same, but it's innards' addresses are different.

Regards
Kitet