N
Neil Guyette
Hi, All,
I'm using a COM object in my application, one of the
methods require a System::Object as a parameter. I need
to pass in a int, therefore I need to cast the int value
as a System::Object but I haven't figured out how to
approach this problem.
//Code sample
Interop::SQLDMO.ApplicationClass *sqlApp;
Interop::SQLDMO.NameList *sqlList;
sqlList = sqlApp.ListSqlServers();
for(int i = 0; i < sqlList.Count; i++)
cmbSqlList.Item.Add(sqlList.Item((System::Object)i);
//the last statement errors because I can't cast int (i)
//to a System::Object. How can this be done?????
Thanks,
-Neil
I'm using a COM object in my application, one of the
methods require a System::Object as a parameter. I need
to pass in a int, therefore I need to cast the int value
as a System::Object but I haven't figured out how to
approach this problem.
//Code sample
Interop::SQLDMO.ApplicationClass *sqlApp;
Interop::SQLDMO.NameList *sqlList;
sqlList = sqlApp.ListSqlServers();
for(int i = 0; i < sqlList.Count; i++)
cmbSqlList.Item.Add(sqlList.Item((System::Object)i);
//the last statement errors because I can't cast int (i)
//to a System::Object. How can this be done?????
Thanks,
-Neil