.net - Visual C++ combobox question -
i still new c++/cli in visual studio 2010 express.i trying add adapters name combobox, go error:
error c2664: 'system::windows::forms::combobox::objectcollection::add' : cannot convert parameter 1 'std::string' 'system::object ^' no user-defined-conversion operator available, or no user-defined-conversion operator available can perform conversion, or operator cannot called
my code is:
public ref class form1 : public system::windows::forms::form { public: form1(void) { initializecomponent(); ip_adapter_info adapterinfo[16]; pip_adapter_info padapterinfo; dword buff=sizeof(adapterinfo); dword getinfo = getadaptersinfo(adapterinfo, &buff); padapterinfo = adapterinfo; { string desc = padapterinfo->description; combobox1->items->add(desc);//error here padapterinfo = padapterinfo->next; }while(padapterinfo); }
what system::object ? seem isn't straightforward in qt..also why constructor/variables loacted in .h file, not in separate .cpp file(assuming using default form1.h)
Comments
Post a Comment