Hi,

I am trying to pass comport name via combobox in managed c++.net but cant seen to get it to work. It returns with the erro message
cannot convert parameter 1 from 'System::String __gc *' to 'LPCSTR'

Can someone help me

This is my function.

String * commPort = commPortsBox->Items->Item[i]->ToString();


HANDLE hCom= ::CreateFile(commPort,GENERIC_WRITE | GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL);


Thanks.