I'm currently coding a MFC DLL with only exported function (no class) and usually I'm using the format
extern "C" void EXPORT_DLL function_name(parameters)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// do something here
}
but now I need to export an array of data. A list of usernames and an IDs (from MongoDB).
Is it possible to export a function that returns a vector of pair like so or will it break because it's not an exportable type?
extern "C" vector<pair<std::string, std::string>> EXPORT_DLL function_name(parameters)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// do something here
return a_vector_of_pair;
}
If it's not possible, what are the other options?
Thanks.