Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

[SOLVED] cannot convert from 'QString' to 'LPCWSTR' ???

$
0
0
I am working on an app where I need to display the file system format of the SD card. Since I couldnt find any Qt API’s for it, I choose a windows API GetVolumeInformation and did it as follows: TCHAR volumeName[MAX_PATH + 1] = { 0 };    TCHAR fileSystemName[MAX_PATH + 1] = { 0 };    DWORD serialNumber = 0;    DWORD maxComponentLen = 0;    DWORD fileSystemFlags = 0;      LPCWSTR path = deviceData->m_strPath;      if (GetVolumeInformation(        path,        volumeName,        ARRAYSIZE(volumeName),        &serialNumber,        &maxComponentLen,        &fileSystemFlags,        fileSystemName,        ARRAYSIZE(fileSystemName)))        {                  qDebug()<<fileSystemName[0];                  qDebug()<<fileSystemName[1];                  qDebug()<<fileSystemName[2];                  qDebug()<<fileSystemName[3];                  qDebug()<<fileSystemName[4];        } path indicates the SD card path and when I run the app, it throws the following error: “cannot convert from ‘QString’ to ‘LPCWSTR’”. Where am i making a mistake??? Please help!!

Viewing all articles
Browse latest Browse all 22112

Trending Articles