QString str("ldap://localhost/"); const char * ldapuri = str.toStdString().c_str(); int ret = ldap_initialize(&cur_session, ldapuri);
C++ (Qt)int ret = ldap_initialize(&cur_session, str.toLocal8Bit().constData());
.... CHAR res[65535]; DWORD retval=QueryDosDeviceA("COM1", res, 65535); QString tmp = QString("retval : %1").arg(retval); qDebug() << tmp; qDebug() << res; QString str; str.fromAscii(res); qDebug() << str;....
QString str = m_ui->lineFName->text();QByteArray ba = str.toLocal8Bit() ;char *tempChar = new char[100];tempChar = ba.data();FileName = tempChar;
ofstream myfile;myfile.open( FileName );
extern openFile( char* fileName );...QString qstrFileName = m_ui->lineFName->text();...openFile( qstrFileName.toLocal8Bit().data() );