I'm working on a managed C++ application that utilizes a C# library to populate a field in an ADO Recordset:
recordset->Fields->GetItem(L"Id")->Value = _variant_t(Library::IdGenerator->GenerateNewId());
However, I'm encountering an error converting the .NET string returned by the library to a _variant_t
before adding it to the recordset.
Here is the error I'm getting:
error C2440: '<function-style-cast>' : cannot convert from 'System::String ^' to '_variant_t'
Am I missing a conversion or cast to get this to work?