Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   C++ DLL export array of struct (https://www.delphipraxis.net/198182-dll-export-array-struct.html)

mandoza 10. Okt 2018 23:49

DLL export array of struct
 
Hello i'v the following function that exports a single instance of a struct :

Code:
struct UserIdentity
{
std::string name;
int id;
};

std::map<std::string, int> g_UserIdentities = { { "Bob", 100 }, { "Jone", 101 },
            { "Alice", 102 }, { "Doe", 103 } };
           
/*
* Will be used in a DLL that will export UserIdentity struct
* OUT _UserIdentity
*/

void Ui_export(UserIdentity *_UserIdentity)
{
for (auto& t : g_UserIdentities)
    {
     _UserIdentity->name = t.first;
     _UserIdentity->id  = t.second;
    }
       
}
So please how could i export an array of _UserIdentity instead of a single instance in my function
Code:
void Ui_export(UserIdentity *_UserIdentity)
thank you .


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:45 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz