EDN Admin
Well-known member
Im having trouble the syntax right for a call from managed c++ to c#.
Heres the c++ code:
<pre style=" switch_status_t SwitchSql::sip_recoverySelectValues( <span style="color:blue const <span style="color:blue char *sqlConnection, Dictionary<String^,String^>^ dicSelect, List<String^> listReturnColumns, switch_core_db_callback_func_t callback, <span style="color:blue void *pdata, <span style="color:blue char **err )
{
switch_status_t ssReturn = SWITCH_STATUS_SUCCESS;
<span style="color:blue do {
<span style="color:green // Ask the SQL code to fetch the data.
String ^strConnection = <span style="color:blue gcnew String(sqlConnection);
String ^strErr;
<span style="color:green // This is where the SQL code will write the return data. It will be converted for the callback.
List<List<String^>^>^ lsReturnValues = <span style="color:blue gcnew List<List<String^>^>();
<span style="color:blue int iReturn = SwitchDb::sip_recoverySelectValues( strConnection, dicSelect, listReturnColumns, lsReturnValues, strErr );
<br/> <code snipped for brevity>[/code]
And heres how the C# code looks:
<pre style=" <span style="color:blue public <span style="color:blue static <span style="color:blue int sip_recoverySelectValues(<span style="color:blue string strConnection, <span style="color:#2b91af Dictionary<<span style="color:#2b91af String, <span style="color:#2b91af String> dicSelect, <span style="color:#2b91af List<<span style="color:#2b91af String> listReturnColumns, <span style="color:blue ref <span style="color:#2b91af List<<span style="color:#2b91af List<<span style="color:#2b91af String>> lsReturnValues, <span style="color:blue out <span style="color:#2b91af String err)
[/code]
And this is the error:
C2664: LyonL::Switch:ata::SwitchDb::sip_recoverySelectValues : cannot convert parameter 3 from System::Collections::Generic::List<T> to System::Collections::Generic::List<T> ^
What am I doing wrong with the listReturnColumns argument?
<hr class="sig Richard Lewis Haggard
View the full article
Heres the c++ code:
<pre style=" switch_status_t SwitchSql::sip_recoverySelectValues( <span style="color:blue const <span style="color:blue char *sqlConnection, Dictionary<String^,String^>^ dicSelect, List<String^> listReturnColumns, switch_core_db_callback_func_t callback, <span style="color:blue void *pdata, <span style="color:blue char **err )
{
switch_status_t ssReturn = SWITCH_STATUS_SUCCESS;
<span style="color:blue do {
<span style="color:green // Ask the SQL code to fetch the data.
String ^strConnection = <span style="color:blue gcnew String(sqlConnection);
String ^strErr;
<span style="color:green // This is where the SQL code will write the return data. It will be converted for the callback.
List<List<String^>^>^ lsReturnValues = <span style="color:blue gcnew List<List<String^>^>();
<span style="color:blue int iReturn = SwitchDb::sip_recoverySelectValues( strConnection, dicSelect, listReturnColumns, lsReturnValues, strErr );
<br/> <code snipped for brevity>[/code]
And heres how the C# code looks:
<pre style=" <span style="color:blue public <span style="color:blue static <span style="color:blue int sip_recoverySelectValues(<span style="color:blue string strConnection, <span style="color:#2b91af Dictionary<<span style="color:#2b91af String, <span style="color:#2b91af String> dicSelect, <span style="color:#2b91af List<<span style="color:#2b91af String> listReturnColumns, <span style="color:blue ref <span style="color:#2b91af List<<span style="color:#2b91af List<<span style="color:#2b91af String>> lsReturnValues, <span style="color:blue out <span style="color:#2b91af String err)
[/code]
And this is the error:
C2664: LyonL::Switch:ata::SwitchDb::sip_recoverySelectValues : cannot convert parameter 3 from System::Collections::Generic::List<T> to System::Collections::Generic::List<T> ^
What am I doing wrong with the listReturnColumns argument?
<hr class="sig Richard Lewis Haggard
View the full article